@@ -13,7 +13,7 @@ import {
1313 MessageCircleQuestionIcon ,
1414 ShieldQuestionIcon ,
1515} from "lucide-react" ;
16- import { useCallback , useEffect , useRef } from "react" ;
16+ import { useEffect , useRef } from "react" ;
1717
1818import { getClientSettings , useClientSettings } from "../hooks/useSettings" ;
1919import { useEnvironmentIds } from "../state/environments" ;
@@ -37,18 +37,18 @@ export function ThreadNotificationCoordinator() {
3737 const pending = useRef (
3838 new Map < string , { environmentId : EnvironmentId ; notification : Notification } > ( ) ,
3939 ) ;
40- const onNotification = useCallback ( ( environmentId : EnvironmentId , notification : Notification ) => {
40+ const onNotification = ( environmentId : EnvironmentId , notification : Notification ) => {
4141 pending . current . get ( notification . tag ) ?. notification . close ( ) ;
4242 pending . current . set ( notification . tag , { environmentId, notification } ) ;
4343 setNotificationBadge ( pending . current . size ) ;
44- } , [ ] ) ;
44+ } ;
4545
4646 useEffect ( ( ) => {
4747 const activeIds = new Set ( environmentIds ) ;
4848 const count = pending . current . size ;
49- for ( const [ tag , { environmentId , notification } ] of pending . current ) {
50- if ( activeIds . has ( environmentId ) ) continue ;
51- notification . close ( ) ;
49+ for ( const [ tag , entry ] of pending . current ) {
50+ if ( activeIds . has ( entry . environmentId ) ) continue ;
51+ entry . notification . close ( ) ;
5252 pending . current . delete ( tag ) ;
5353 }
5454 if ( count !== pending . current . size ) setNotificationBadge ( pending . current . size ) ;
0 commit comments