Fix authentication with debug mode (#532)

Fix authent with debug mode
This commit is contained in:
Charles Bochet
2023-07-07 14:10:04 -07:00
committed by GitHub
parent c847bca293
commit f62fdc1219
4 changed files with 30 additions and 26 deletions

View File

@ -1,4 +1,4 @@
import { useEffect, useMemo, useRef } from 'react';
import { useMemo, useRef } from 'react';
import {
ApolloLink,
InMemoryCache,
@ -67,16 +67,11 @@ export function useApolloFactory() {
},
extraLinks: isMockMode ? [mockLink] : [],
isDebugMode,
tokenPair,
});
return apolloRef.current.getClient();
}, [isMockMode, setTokenPair, isDebugMode]);
useEffect(() => {
if (apolloRef.current) {
apolloRef.current.updateTokenPair(tokenPair);
}
}, [tokenPair]);
}, [isMockMode, setTokenPair, isDebugMode, tokenPair]);
return apolloClient;
}