Skip to content

Commit

Permalink
enable react-query dev tools
Browse files Browse the repository at this point in the history
  • Loading branch information
MSzalowski committed Oct 31, 2024
1 parent 431270a commit efa0a47
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
19 changes: 18 additions & 1 deletion govtool/frontend/src/hooks/queries/useGetDRepListQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,23 @@ export const useGetDRepListInfiniteQuery = (
) => {
const { pendingTransaction } = useCardano();

console.log({

Check failure on line 20 in govtool/frontend/src/hooks/queries/useGetDRepListQuery.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement
queryKey: [
QUERY_KEYS.useGetDRepListInfiniteKey,
(
pendingTransaction.registerAsDirectVoter ||
pendingTransaction.registerAsDrep ||
pendingTransaction.retireAsDirectVoter ||
pendingTransaction.retireAsDrep
)?.transactionHash ?? "noPendingTransaction",
filters.length ? filters : "",
searchPhrase ?? "",
sorting ?? "",
status?.length ? status : "",
],
enabled: options?.enabled,
});

const {
data,
isLoading,
Expand All @@ -33,7 +50,7 @@ export const useGetDRepListInfiniteQuery = (
pendingTransaction.registerAsDrep ||
pendingTransaction.retireAsDirectVoter ||
pendingTransaction.retireAsDrep
)?.transactionHash ?? 'noPendingTransaction',
)?.transactionHash ?? "noPendingTransaction",
filters.length ? filters : "",
searchPhrase ?? "",
sorting ?? "",
Expand Down
10 changes: 7 additions & 3 deletions govtool/frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ const { version } = pkg;

const queryClient = new QueryClient();

const ReactQueryDevtoolsProduction = React.lazy(() =>
import("react-query/devtools/development").then((d) => ({
default: d.ReactQueryDevtools,
})),
);

const tagManagerArgs = {
gtmId: import.meta.env.VITE_GTM_ID,
};
Expand Down Expand Up @@ -59,9 +65,7 @@ ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
</BrowserRouter>
</UsersnapProvider>
</ThemeProvider>
{import.meta.env.VITE_IS_DEV && (
<ReactQueryDevtools initialIsOpen={false} />
)}
<ReactQueryDevtoolsProduction initialIsOpen={false} />
</QueryClientProvider>
</React.StrictMode>,
);
2 changes: 1 addition & 1 deletion govtool/frontend/src/pages/DRepDirectoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({

useEffect(() => {
if (!chosenSorting) setChosenSorting(DRepListSort.Random);
}, [chosenSorting, setChosenSorting]);
}, []);

const { delegate, isDelegating } = useDelegateTodRep();

Expand Down

0 comments on commit efa0a47

Please sign in to comment.