Restore refetchIntervalInBackground for unread count polling

The W-03 QA fix (removing refetchIntervalInBackground) broke toast
notifications when the receiver tab is hidden (e.g. user switches to
sender's tab). Without background polling, unread count never updates,
NotificationToaster never detects new notifications, and no toast fires.

Restored with explanatory comment documenting the dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kyle 2026-03-05 19:30:16 +08:00
parent 4e2d48c50b
commit 360a14b87b

View File

@ -49,6 +49,9 @@ export function NotificationProvider({ children }: { children: ReactNode }) {
return data.count;
},
refetchInterval: 15_000,
// Required: toast notifications depend on background polling to detect new
// notifications when the tab is hidden (e.g. user switches to sender tab).
refetchIntervalInBackground: true,
staleTime: 10_000,
});