Commit 628bfb4f authored by tom's avatar tom

more debug

parent 117f9c9a
...@@ -27,7 +27,8 @@ export default function useFetch() { ...@@ -27,7 +27,8 @@ export default function useFetch() {
}; };
return fetch(path, reqParams).then(response => { return fetch(path, reqParams).then(response => {
// eslint-disable-next-line no-debugger
debugger;
if (!response.ok) { if (!response.ok) {
const error = { const error = {
status: response.status, status: response.status,
...@@ -49,8 +50,6 @@ export default function useFetch() { ...@@ -49,8 +50,6 @@ export default function useFetch() {
); );
} else { } else {
// eslint-disable-next-line no-debugger
debugger;
if (path.includes(RESOURCES.csrf.path)) { if (path.includes(RESOURCES.csrf.path)) {
return Promise.resolve({ token: response.headers.get('x-bs-account-csrf') }) as unknown as Promise<Success>; return Promise.resolve({ token: response.headers.get('x-bs-account-csrf') }) as unknown as Promise<Success>;
} }
......
...@@ -15,6 +15,14 @@ import theme from 'theme'; ...@@ -15,6 +15,14 @@ import theme from 'theme';
import AppError from 'ui/shared/AppError/AppError'; import AppError from 'ui/shared/AppError/AppError';
import ErrorBoundary from 'ui/shared/ErrorBoundary'; 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) { function MyApp({ Component, pageProps }: AppProps) {
useConfigSentry(); useConfigSentry();
const [ queryClient ] = useState(() => new QueryClient({ const [ queryClient ] = useState(() => new QueryClient({
...@@ -54,6 +62,14 @@ function MyApp({ Component, pageProps }: AppProps) { ...@@ -54,6 +62,14 @@ function MyApp({ Component, pageProps }: AppProps) {
Sentry.captureException(error); 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 ( return (
<Chakra theme={ theme } cookies={ pageProps.cookies }> <Chakra theme={ theme } cookies={ pageProps.cookies }>
<ErrorBoundary renderErrorScreen={ renderErrorScreen } onError={ handleError }> <ErrorBoundary renderErrorScreen={ renderErrorScreen } onError={ handleError }>
...@@ -65,6 +81,11 @@ function MyApp({ Component, pageProps }: AppProps) { ...@@ -65,6 +81,11 @@ function MyApp({ Component, pageProps }: AppProps) {
</SocketProvider> </SocketProvider>
</ScrollDirectionProvider> </ScrollDirectionProvider>
<ReactQueryDevtools/> <ReactQueryDevtools/>
{ showDevtools && (
<React.Suspense fallback={ null }>
<ReactQueryDevtoolsProduction/>
</React.Suspense>
) }
</QueryClientProvider> </QueryClientProvider>
</AppContextProvider> </AppContextProvider>
</ErrorBoundary> </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