fix: a channel open in a tab behind another is no longer marked read (#34450)

This commit is contained in:
G30 authored and GitHub committed 2026-11-16 15:37:59 +09:00
1 parent 6aa5988428
commit 42f8d4252d
1 file changed
+3 -3
+3 -3
View File
@@ -188,12 +188,12 @@
};
const initHandler = async () => {
if (currentId) {
if (currentId && $active) {
updateLastReadAt(currentId);
}
currentId = id;
updateLastReadAt(id);
if ($active) updateLastReadAt(id);
top = false;
messages = null;
@@ -410,7 +410,7 @@
onDestroy(() => {
stopInvitation();
// last read at
updateLastReadAt(id);
if ($active) updateLastReadAt(id);
if ($_channelId === id) _channelId.set(null);
$socket?.off('events:channel', channelEventHandler);
mediaQuery?.removeEventListener('change', handleMediaQuery);