fix: fetch notifications immediately when recipient changes (#380)

Notifications were stale until the next poll after switching recipients. Now fetchNotifications() is called immediately on recipient change.
This commit is contained in:
Héctor Arriola 2026-03-15 05:29:21 -06:00 committed by GitHub
parent 2449363868
commit d89183ee48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -48,8 +48,9 @@ export function NotificationsPanel() {
useEffect(() => { useEffect(() => {
if (recipient) { if (recipient) {
window.localStorage.setItem('mc.notifications.recipient', recipient) window.localStorage.setItem('mc.notifications.recipient', recipient)
fetchNotifications()
} }
}, [recipient]) }, [recipient, fetchNotifications])
useSmartPoll(fetchNotifications, 30000, { enabled: !!recipient, pauseWhenSseConnected: true }) useSmartPoll(fetchNotifications, 30000, { enabled: !!recipient, pauseWhenSseConnected: true })