mirror of
https://github.com/urosran/cally.git
synced 2025-07-16 10:06:15 +00:00
Reimplementation of the todo take turns feature to fix issues with only one assignee showing
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user