- Fixed issue with date resetting every time a repeat type is selected

- Showing take turns button when todo has repeat rule and has more than 1 assignee
This commit is contained in:
Dejan
2024-12-08 12:00:42 +01:00
parent 11115d151d
commit 89bb924b40
2 changed files with 18 additions and 16 deletions

View File

@ -240,8 +240,8 @@ const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => {
if (value) {
setTodo((oldValue) => ({
...oldValue,
date: new Date(),
repeatType: value.toString(),
repeatDays: []
}));
}
}}
@ -315,6 +315,7 @@ const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => {
setSelectedAttendees={setSelectedAssignees}
/>
</View>
{todo.repeatType !== REPEAT_TYPE.NONE && selectedAssignees?.length > 1 &&
<View row centerV style={styles.rotateSwitch}>
<Text style={{fontFamily: "PlusJakartaSans_500Medium", fontSize: 16}}>
Take Turns
@ -329,6 +330,7 @@ const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => {
}
/>
</View>
}
<View style={styles.divider}/>
<View marginH-30 marginB-15 row centerV>
<Ionicons name="gift-outline" size={25} color="#919191"/>

View File

@ -42,8 +42,8 @@ export const useUpdateSubUser = () => {
}
},
onSuccess: () => {
queryClient.invalidateQueries({queryKey: ["getChildrenByParentId"]})
queryClient.invalidateQueries({queryKey: ["familyMembers"]})
queryClient.invalidateQueries({queryKey: ["profiles"]})
}
});
}