Update timers whenever we mark messages read

This commit is contained in:
Scott Nonnenberg 2021-07-19 13:45:18 -07:00 committed by GitHub
parent cd35a29638
commit 7761d83055
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 70 additions and 150 deletions

View file

@ -11,9 +11,7 @@ const updateMessageBatcher = createBatcher<MessageAttributesType>({
maxSize: 50,
processBatch: async (messageAttrs: Array<MessageAttributesType>) => {
window.log.info('updateMessageBatcher', messageAttrs.length);
await window.Signal.Data.saveMessages(messageAttrs, {
Message: window.Whisper.Message,
});
await window.Signal.Data.saveMessages(messageAttrs);
},
});
@ -23,9 +21,7 @@ export function queueUpdateMessage(messageAttr: MessageAttributesType): void {
if (shouldBatch) {
updateMessageBatcher.add(messageAttr);
} else {
window.Signal.Data.saveMessage(messageAttr, {
Message: window.Whisper.Message,
});
window.Signal.Data.saveMessage(messageAttr);
}
}
@ -41,7 +37,6 @@ export const saveNewMessageBatcher = createWaitBatcher<MessageAttributesType>({
window.log.info('saveNewMessageBatcher', messageAttrs.length);
await window.Signal.Data.saveMessages(messageAttrs, {
forceSave: true,
Message: window.Whisper.Message,
});
},
});