Extracted the list building on the events screen to a separate method, updated the firebase function to handle updates on the "done" field in tasks
This commit is contained in:
parent
dfe52b77ef
commit
09555aeadf
3 changed files with 23 additions and 14 deletions
|
|
@ -121,6 +121,11 @@ export const pendingTasksUpdater: functions.CloudFunction<functions.Change<Fireb
|
|||
await incrementPendingTasks(eventDocument, decrementValue);
|
||||
break;
|
||||
case 'update':
|
||||
if (before.get('done') !== after.get('done')) {
|
||||
const value = after.get('done') ? decrementValue : incrementValue;
|
||||
await incrementFromPriority(after.get('priority'), eventDocument, userDocument, value);
|
||||
await incrementPendingTasks(eventDocument, value);
|
||||
}
|
||||
if (before.get('priority') !== after.get('priority')) {
|
||||
await incrementFromPriority(before.get('priority'), eventDocumentBefore!, userDocument, decrementValue);
|
||||
await incrementFromPriority(after.get('priority'), eventDocument, userDocument, incrementValue);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue