From ae09bfb8fdfc93f9e74461fe91d7fca1a9734748 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 9 Jul 2020 10:22:04 -0600 Subject: [PATCH] Don't destroy room notification states when replacing them The "should never happen" now happens a lot by design. We shouldn't destroy the state as it'll stop badge counts for everything. Fixes https://github.com/vector-im/riot-web/issues/14391 --- src/stores/notifications/ListNotificationState.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/stores/notifications/ListNotificationState.ts b/src/stores/notifications/ListNotificationState.ts index 6c5f6fc6dd..6c67dbdd08 100644 --- a/src/stores/notifications/ListNotificationState.ts +++ b/src/stores/notifications/ListNotificationState.ts @@ -55,11 +55,6 @@ export class ListNotificationState extends NotificationState { for (const newRoom of diff.added) { const state = this.getRoomFn(newRoom); state.on(NOTIFICATION_STATE_UPDATE, this.onRoomNotificationStateUpdate); - if (this.states[newRoom.roomId]) { - // "Should never happen" disclaimer. - console.warn("Overwriting notification state for room:", newRoom.roomId); - this.states[newRoom.roomId].destroy(); - } this.states[newRoom.roomId] = state; }