Spaces:
Sleeping
Sleeping
fix: fetch notifications immediately when recipient changes (#380)
Browse filesNotifications were stale until the next poll after switching recipients. Now fetchNotifications() is called immediately on recipient change.
src/components/panels/notifications-panel.tsx
CHANGED
|
@@ -48,8 +48,9 @@ export function NotificationsPanel() {
|
|
| 48 |
useEffect(() => {
|
| 49 |
if (recipient) {
|
| 50 |
window.localStorage.setItem('mc.notifications.recipient', recipient)
|
|
|
|
| 51 |
}
|
| 52 |
-
}, [recipient])
|
| 53 |
|
| 54 |
useSmartPoll(fetchNotifications, 30000, { enabled: !!recipient, pauseWhenSseConnected: true })
|
| 55 |
|
|
|
|
| 48 |
useEffect(() => {
|
| 49 |
if (recipient) {
|
| 50 |
window.localStorage.setItem('mc.notifications.recipient', recipient)
|
| 51 |
+
fetchNotifications()
|
| 52 |
}
|
| 53 |
+
}, [recipient, fetchNotifications])
|
| 54 |
|
| 55 |
useSmartPoll(fetchNotifications, 30000, { enabled: !!recipient, pauseWhenSseConnected: true })
|
| 56 |
|