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:
parent
2449363868
commit
d89183ee48
|
|
@ -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 })
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue