Commit 628bfb4f authored by tom's avatar tom

more debug

parent 117f9c9a
......@@ -27,7 +27,8 @@ export default function useFetch() {
};
return fetch(path, reqParams).then(response => {
// eslint-disable-next-line no-debugger
debugger;
if (!response.ok) {
const error = {
status: response.status,
......@@ -49,8 +50,6 @@ export default function useFetch() {
);
} else {
// eslint-disable-next-line no-debugger
debugger;
if (path.includes(RESOURCES.csrf.path)) {
return Promise.resolve({ token: response.headers.get('x-bs-account-csrf') }) as unknown as Promise<Success>;
}
......
......@@ -15,6 +15,14 @@ import theme from 'theme';
import AppError from 'ui/shared/AppError/AppError';
import ErrorBoundary from 'ui/shared/ErrorBoundary';
const ReactQueryDevtoolsProduction = React.lazy(() =>
import('@tanstack/react-query-devtools/build/lib/index.prod.js').then(
(d) => ({
'default': d.ReactQueryDevtools,
}),
),
);
function MyApp({ Component, pageProps }: AppProps) {
useConfigSentry();
const [ queryClient ] = useState(() => new QueryClient({
......@@ -54,6 +62,14 @@ function MyApp({ Component, pageProps }: AppProps) {
Sentry.captureException(error);
}, []);
const [ showDevtools, setShowDevtools ] = React.useState(false);
React.useEffect(() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
window.toggleDevtools = () => setShowDevtools((old) => !old);
}, []);
return (
<Chakra theme={ theme } cookies={ pageProps.cookies }>
<ErrorBoundary renderErrorScreen={ renderErrorScreen } onError={ handleError }>
......@@ -65,6 +81,11 @@ function MyApp({ Component, pageProps }: AppProps) {
</SocketProvider>
</ScrollDirectionProvider>
<ReactQueryDevtools/>
{ showDevtools && (
<React.Suspense fallback={ null }>
<ReactQueryDevtoolsProduction/>
</React.Suspense>
) }
</QueryClientProvider>
</AppContextProvider>
</ErrorBoundary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment