Add back pickers on all pages, fix command menu (#2662)
* Add back pickers on all pages, fix command menu * Fix lint
This commit is contained in:
@ -5,6 +5,9 @@ import { useApolloFactory } from '@/apollo/hooks/useApolloFactory';
|
||||
export const ApolloProvider = ({ children }: React.PropsWithChildren) => {
|
||||
const apolloClient = useApolloFactory();
|
||||
|
||||
// This will attach the right apollo client to Apollo Dev Tools
|
||||
window.__APOLLO_CLIENT__ = apolloClient;
|
||||
|
||||
return (
|
||||
<ApolloProviderBase client={apolloClient}>{children}</ApolloProviderBase>
|
||||
);
|
||||
|
||||
@ -83,6 +83,18 @@ export class ApolloFactory<TCacheShape> implements ApolloManager<TCacheShape> {
|
||||
onErrorCb?.(graphQLErrors);
|
||||
|
||||
for (const graphQLError of graphQLErrors) {
|
||||
if (graphQLError.message === 'Unauthorized') {
|
||||
return fromPromise(
|
||||
renewToken(uri, this.tokenPair)
|
||||
.then((tokens) => {
|
||||
onTokenPairChange?.(tokens);
|
||||
})
|
||||
.catch(() => {
|
||||
onUnauthenticatedError?.();
|
||||
}),
|
||||
).flatMap(() => forward(operation));
|
||||
}
|
||||
|
||||
switch (graphQLError?.extensions?.code) {
|
||||
case 'UNAUTHENTICATED': {
|
||||
return fromPromise(
|
||||
|
||||
Reference in New Issue
Block a user