fix notification not working for selected room (#1864)
authorAjay Bura <32841439+ajbura@users.noreply.github.com>
Sun, 4 Aug 2024 05:37:28 +0000 (11:07 +0530)
committerGitHub <noreply@github.com>
Sun, 4 Aug 2024 05:37:28 +0000 (15:37 +1000)
src/app/pages/client/ClientNonUIFeatures.tsx
src/app/pages/client/sidebar/UnverifiedTab.tsx

index 845fceb3ff1c7a913d40c826f28ac65aa20254b8..ffe33e9af25baef99e4b5f097a4265be845d0c38 100644 (file)
@@ -183,17 +183,17 @@ function MessageNotifications() {
       removed,
       data
     ) => {
+      if (mx.getSyncState() !== 'SYNCING') return;
+      if (document.hasFocus() && (selectedRoomId === room?.roomId || notificationSelected)) return;
       if (
-        mx.getSyncState() !== 'SYNCING' ||
-        selectedRoomId === room?.roomId ||
-        notificationSelected ||
         !room ||
         !data.liveEvent ||
         room.isSpaceRoom() ||
         !isNotificationEvent(mEvent) ||
         getNotificationType(mx, room.roomId) === NotificationType.Mute
-      )
+      ) {
         return;
+      }
 
       const sender = mEvent.getSender();
       const eventId = mEvent.getId();
index 402ffc2b82d5c9bb632b6d03f3289869f9edb53d..919c4a708a25b254512b538aaf85ed917e6590bc 100644 (file)
@@ -16,11 +16,9 @@ import * as css from './UnverifiedTab.css';
 export function UnverifiedTab() {
   const mx = useMatrixClient();
   const deviceList = useDeviceList();
-  console.log(deviceList);
   const unverified = deviceList?.filter(
     (device) => isCrossVerified(mx, device.device_id) === false
   );
-  console.log(unverified);
 
   if (!unverified?.length) return null;