Suppress sticker pack installation errors on startup re-download

This commit is contained in:
Scott Nonnenberg 2022-03-23 14:33:48 -07:00 committed by GitHub
parent 2eaacac151
commit 6a671e73f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 18 deletions

View file

@ -164,11 +164,18 @@ function stickerAdded(payload: StickerDBType): StickerAddedAction {
};
}
function stickerPackAdded(payload: StickerPackDBType): StickerPackAddedAction {
function stickerPackAdded(
payload: StickerPackDBType,
options?: { suppressError?: boolean }
): StickerPackAddedAction {
const { status, attemptedStatus } = payload;
// We do this to trigger a toast, which is still done via Backbone
if (status === 'error' && attemptedStatus === 'installed') {
if (
status === 'error' &&
attemptedStatus === 'installed' &&
!options?.suppressError
) {
trigger('pack-install-failed');
}
@ -280,12 +287,17 @@ function clearInstalledStickerPack(): ClearInstalledStickerPackAction {
function stickerPackUpdated(
packId: string,
patch: Partial<StickerPackDBType>
patch: Partial<StickerPackDBType>,
options?: { suppressError?: boolean }
): StickerPackUpdatedAction {
const { status, attemptedStatus } = patch;
// We do this to trigger a toast, which is still done via Backbone
if (status === 'error' && attemptedStatus === 'installed') {
if (
status === 'error' &&
attemptedStatus === 'installed' &&
!options?.suppressError
) {
trigger('pack-install-failed');
}