spacedrive/interface/components/Devtools.tsx
Oscar Beaumont 89a7f735e5
[ENG-1400] Normalised caching (#1734)
* prototype

* `.normalise` helper + only `String` keys

* implement it for 'search.paths'

* redux devtools

* fix

* refactor backend

* wip: upgrade to rspc fork

* mega cursed

* Upgrade Specta-related stuff

* Upgrade Typescript

* Cache debug page

* bruh

* Fix optimistic library setting

* Cache clearing

* better timeout

* Fix tags page

* bit of cleanup

---------

Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2023-12-05 13:16:03 +00:00

25 lines
681 B
TypeScript

import { defaultContext } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { useDebugState } from '@sd/client';
export const Devtools = () => {
const debugState = useDebugState();
return (
<>
{debugState.reactQueryDevtools !== 'disabled' ? (
<ReactQueryDevtools
position="bottom-right"
// The `context={defaultContext}` part is required for this to work on Windows.
// Why, idk, don't question it
context={defaultContext}
toggleButtonProps={{
tabIndex: -1,
className: debugState.reactQueryDevtools === 'invisible' ? 'opacity-0' : ''
}}
/>
) : null}
</>
);
};