Skip to content

Commit

Permalink
Using enabled flag in useFetchCache query
Browse files Browse the repository at this point in the history
Signed-off-by: Maayan Hadasi <[email protected]>
  • Loading branch information
mguetta1 committed Oct 7, 2024
1 parent 440fdd3 commit ee7c7a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/app/pages/repositories/Mvn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const RepositoriesMvn: React.FC = () => {
isAriaDisabled={inputDisabled}
onClick={() => setIsConfirmDialogOpen(true)}
>
{isRWXSupported && isFetching ? (
{isFetching ? (
<Text>
Loading...
<Spinner
Expand Down
2 changes: 2 additions & 0 deletions client/src/app/queries/cache.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useMutation, useQuery } from "@tanstack/react-query";

import { deleteCache, getCache } from "@app/api/rest";
import { isRWXSupported } from "@app/Constants";

export const CacheQueryKey = "cache";
export const CleanProgressQueryKey = "cleanProgress";
Expand All @@ -10,6 +11,7 @@ export const useFetchCache = () =>
queryKey: [CacheQueryKey],
queryFn: getCache,
onError: (error) => console.log("error, ", error),
enabled: isRWXSupported,
});

export const useDeleteCacheMutation = (
Expand Down

0 comments on commit ee7c7a2

Please sign in to comment.