Merge pull request #984 from automatisch/add-chatwoot

feat: add chatwoot
This commit is contained in:
Ömer Faruk Aydın
2023-03-07 23:21:47 +01:00
committed by GitHub
6 changed files with 116 additions and 4 deletions

View File

@@ -33,13 +33,16 @@ const createErrorLink = (callback: CreateLinkOptions['onError']): ApolloLink =>
callback?.(message);
}
console.log(
console.error(
`[GraphQL error]: Message: ${message}, Location: ${locations}, Path: ${path}`
);
if (message === NOT_AUTHORISED) {
setItem('token', '');
window.location.href = URLS.LOGIN;
if (window.location.pathname !== URLS.LOGIN) {
window.location.href = URLS.LOGIN;
}
}
});
@@ -47,12 +50,13 @@ const createErrorLink = (callback: CreateLinkOptions['onError']): ApolloLink =>
if (autoSnackbar) {
callback?.(networkError.toString());
}
console.log(`[Network error]: ${networkError}`);
console.error(`[Network error]: ${networkError}`);
}
});
// eslint-disable-next-line @typescript-eslint/no-empty-function
const noop = () => {};
const noop = () => { };
const createLink = (options: CreateLinkOptions): ApolloLink => {
const { uri, onError = noop, token } = options;