Reimplementation of the todo take turns feature to fix issues with only one assignee showing

This commit is contained in:
Dejan
2025-02-15 18:39:54 +01:00
parent f649828d80
commit 59664488e8
5 changed files with 22 additions and 7 deletions

View File

@ -130,7 +130,7 @@ export const useCreateTodo = () => {
let assignee;
if (todoData.assignees && todoData.rotate && todoData?.assignees?.length !== 0) {
assignee = todoData.assignees[index % todoData.assignees.length];
assignee = todoData.assignees[(index + 1) % todoData.assignees.length];
}
const nextTodo = {
@ -140,7 +140,8 @@ export const useCreateTodo = () => {
familyId: profileData?.familyId,
creatorId: currentUser?.uid,
connectedTodoId: ruleDocRef.id,
assignees: assignee ? [assignee] : todoData.assignees
assignees: todoData.assignees,
currentAssignee: assignee
}
batch.set(newDocRef, nextTodo)