@@ -9,17 +9,16 @@ type ClientRef = {
99interface UseClientRefProps {
1010 authUrl : string
1111 minSecondsBeforeRefresh ?: number
12- skipInitialFetch ?: boolean
1312}
1413
1514export const useClientRef = ( props : UseClientRefProps ) => {
1615 const [ accessTokenChangeCounter , setAccessTokenChangeCounter ] = useState ( 0 )
17- const { authUrl, minSecondsBeforeRefresh, skipInitialFetch } = props
16+ const { authUrl, minSecondsBeforeRefresh } = props
1817
1918 // Use a ref to store the client so that it doesn't get recreated on every render
2019 const clientRef = useRef < ClientRef | null > ( null )
2120 if ( clientRef . current === null ) {
22- const client = createClient ( { authUrl, enableBackgroundTokenRefresh : true , minSecondsBeforeRefresh, skipInitialFetch } )
21+ const client = createClient ( { authUrl, enableBackgroundTokenRefresh : true , minSecondsBeforeRefresh, skipInitialFetch : true } )
2322 client . addAccessTokenChangeObserver ( ( ) => setAccessTokenChangeCounter ( ( x ) => x + 1 ) )
2423 clientRef . current = { authUrl, client }
2524 }
@@ -33,7 +32,7 @@ export const useClientRef = (props: UseClientRefProps) => {
3332 } else {
3433 clientRef . current . client . destroy ( )
3534
36- const newClient = createClient ( { authUrl, enableBackgroundTokenRefresh : true , minSecondsBeforeRefresh, skipInitialFetch } )
35+ const newClient = createClient ( { authUrl, enableBackgroundTokenRefresh : true , minSecondsBeforeRefresh, skipInitialFetch : true } )
3736 newClient . addAccessTokenChangeObserver ( ( ) => setAccessTokenChangeCounter ( ( x ) => x + 1 ) )
3837 clientRef . current = { authUrl, client : newClient }
3938 }
0 commit comments