From d89183ee480ff1d5a092809ee2ee54429351148c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Arriola?= Date: Sun, 15 Mar 2026 05:29:21 -0600 Subject: [PATCH] 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. --- src/components/panels/notifications-panel.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/panels/notifications-panel.tsx b/src/components/panels/notifications-panel.tsx index 35b6992..2fa5522 100644 --- a/src/components/panels/notifications-panel.tsx +++ b/src/components/panels/notifications-panel.tsx @@ -48,8 +48,9 @@ export function NotificationsPanel() { useEffect(() => { if (recipient) { window.localStorage.setItem('mc.notifications.recipient', recipient) + fetchNotifications() } - }, [recipient]) + }, [recipient, fetchNotifications]) useSmartPoll(fetchNotifications, 30000, { enabled: !!recipient, pauseWhenSseConnected: true })