File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/compass-home/src/components Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import { css } from '@emotion/css' ;
2- import React , { useEffect , useReducer } from 'react' ;
2+ import React , { useCallback , useEffect , useReducer } from 'react' ;
33import {
44 DataService ,
55 getConnectionTitle ,
@@ -200,7 +200,7 @@ function Home({ appName }: { appName: string }): React.ReactElement | null {
200200 } ) ;
201201 }
202202
203- function onDataServiceDisconnected ( ) {
203+ const onDataServiceDisconnected = useCallback ( ( ) => {
204204 const StatusAction = appRegistry . getAction (
205205 AppRegistryActions . STATUS_ACTIONS
206206 ) as StatusActionType | undefined ;
@@ -209,7 +209,7 @@ function Home({ appName }: { appName: string }): React.ReactElement | null {
209209 } ) ;
210210 updateTitle ( appName ) ;
211211 StatusAction ?. done ( ) ;
212- }
212+ } , [ appRegistry , appName ] ) ;
213213
214214 useEffect ( ( ) => {
215215 if ( isConnected ) {
@@ -248,7 +248,7 @@ function Home({ appName }: { appName: string }): React.ReactElement | null {
248248 ) ;
249249 appRegistry . removeListener ( 'all-collection-tabs-closed' , onAllTabsClosed ) ;
250250 } ;
251- } ) ;
251+ } , [ appRegistry , onDataServiceDisconnected ] ) ;
252252
253253 if ( isConnected ) {
254254 return (
You can’t perform that action at this time.
0 commit comments