Suppress sticker pack installation errors on startup re-download
This commit is contained in:
parent
2eaacac151
commit
6a671e73f9
2 changed files with 35 additions and 18 deletions
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue