fix disable in app notifs on desktop

This commit is contained in:
7w1 committed 2026-03-05 23:58:09 -06:00
1 parent ae71309a1f
commit 9ef4531eee
2 files changed
+16 -13

No files matched your search

@@ -190,18 +190,20 @@ export function SystemNotification() {
return (
<Box direction="Column" gap="100">
<Text size="L400">System & Notifications</Text>
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<SettingTile
title="In-App Notifications"
description="Show a notification banner inside the app when a message arrives."
after={<Switch value={showInAppNotifs} onChange={setShowInAppNotifs} />}
/>
</SequenceCard>
{mobileOrTablet() && (
<SequenceCard
className={SequenceCardStyle}
variant="SurfaceVariant"
direction="Column"
gap="400"
>
<SettingTile
title="Mobile In-App Notifications"
description="Show a notification banner inside the app when a message arrives."
after={<Switch value={showInAppNotifs} onChange={setShowInAppNotifs} />}
/>
</SequenceCard>
)}
{mobileOrTablet() && (
<SequenceCard
className={SequenceCardStyle}
@@ -37,6 +37,7 @@ import {
} from '$utils/notificationStyle';
import { startClient, stopClient } from '$client/initMatrix';
import { useClientConfig } from '$hooks/useClientConfig';
import { mobileOrTablet } from '$utils/user-agent';
const log = createLogger('BackgroundNotifications');
const isClientReadyForNotifications = (state: SyncState | string | null): boolean =>
@@ -281,7 +282,7 @@ export function BackgroundNotifications() {
if (document.visibilityState !== 'visible') return;
// Respect in-app notification setting (read from ref to avoid stale closure)
if (!showNotificationsRef.current) return;
if (!mobileOrTablet() || !showNotificationsRef.current) return;
const notificationPayload = buildRoomMessageNotification({
roomName: room.name ?? room.getCanonicalAlias() ?? room.roomId,