Guard realtime updates on unmount
cgen-2edf604a070a4f9fa89e5cb0531d8646
This commit is contained in:
parent
1dc3a5caec
commit
07d75bd7cb
1 changed files with 1 additions and 0 deletions
|
|
@ -87,6 +87,7 @@ export default function NotificationBell({ className }: { className?: string })
|
|||
const subscription = aethexRealtimeService.subscribeToUserNotifications(
|
||||
user.id,
|
||||
(payload: any) => {
|
||||
if (!isActive) return;
|
||||
const next = (payload?.new ?? payload) as AethexNotification | undefined;
|
||||
if (!next?.id) return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue