fix: Disable redeem button when points exceed available limit

This commit is contained in:
Mo Tarbin 2025-01-18 09:53:32 -05:00
parent 9dc3edb40e
commit 4e64d0b24e
2 changed files with 3 additions and 2 deletions

View file

@ -48,6 +48,7 @@ function RedeemPointsModal({ config }) {
{predefinedPoints.map(point => (
<IconButton
variant='outlined'
disabled={points + point > config.available}
sx={{ borderRadius: '50%' }}
key={point}
onClick={() => {
@ -69,7 +70,7 @@ function RedeemPointsModal({ config }) {
<Button
onClick={() =>
config.onSave({
points,
points: Number(points),
userId: config.user.userId,
})
}

View file

@ -192,7 +192,7 @@ const TaskInput = ({ autoFocus, onChoreUpdate }) => {
},
{
frequencyType: 'daily',
regex: /(every day|daily)$/i,
regex: /(every day|daily|everyday)$/i,
name: 'Every day',
},
{