- Added validation on todo creation to avoid creating todos with Every week repeat type, but no selected days

- Reworked and improved the creation of repeat todo
This commit is contained in:
Dejan
2024-12-15 15:31:55 +01:00
parent d30ed9b130
commit 4f96bb071b
2 changed files with 103 additions and 82 deletions

View File

@ -120,6 +120,10 @@ const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => {
Alert.alert('Alert', 'Cannot have a todo without any assignees');
return false;
}
if (todo?.repeatType === REPEAT_TYPE.EVERY_WEEK && todo?.repeatDays?.length === 0) {
Alert.alert('Alert', 'Please select a specific day for the Weekly recurrence');
return false;
}
return true;
}