Simplify messageReceiver initialization & reset

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
trevor-signal 2024-04-02 16:43:20 -04:00 committed by GitHub
parent f057bc560f
commit dfd564e67f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 318 additions and 289 deletions

View file

@ -26,6 +26,7 @@ import { SignalService as Proto } from '../protobuf';
import * as log from '../logging/log';
import type { StickersStateType } from '../state/ducks/stickers';
import { MINUTE } from '../util/durations';
import { drop } from '../util/drop';
export type StickerType = {
packId: string;
@ -173,6 +174,7 @@ export function getInstalledStickerPacks(): Array<StickerPackType> {
}
export function downloadQueuedPacks(): void {
log.info('downloadQueuedPacks');
strictAssert(packsToDownload, 'Stickers not initialized');
const ids = Object.keys(packsToDownload);
@ -180,10 +182,12 @@ export function downloadQueuedPacks(): void {
const { key, status } = packsToDownload[id];
// The queuing is done inside this function, no need to await here
void downloadStickerPack(id, key, {
finalStatus: status,
suppressError: true,
});
drop(
downloadStickerPack(id, key, {
finalStatus: status,
suppressError: true,
})
);
}
packsToDownload = {};