Stickers: Correct processing of sticker updates with non-existent identifiers (#2993)
This commit is contained in:
parent
aaca95737c
commit
a30eede3ad
@ -54,9 +54,13 @@ addActionHandler('apiUpdate', (global, actions, update): ActionReturnType => {
|
|||||||
actions.loadStickerSets();
|
actions.loadStickerSets();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'updateStickerSetsOrder':
|
case 'updateStickerSetsOrder': {
|
||||||
actions.reorderStickerSets({ order: update.order, isCustomEmoji: update.isCustomEmoji });
|
// Filter out invalid set IDs, which may be sent by the server
|
||||||
|
const order = update.order.filter((setId) => Boolean(global.stickers.setsById[setId]));
|
||||||
|
|
||||||
|
actions.reorderStickerSets({ order, isCustomEmoji: update.isCustomEmoji });
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'updateSavedGifs':
|
case 'updateSavedGifs':
|
||||||
actions.loadSavedGifs();
|
actions.loadSavedGifs();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user