mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 15:27:27 +00:00
feat: switched to is fetching
This commit is contained in:
@@ -19,10 +19,10 @@ export const CachingPanel = () => {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
data: invalidationStatus,
|
data: invalidationStatus,
|
||||||
isPending,
|
isFetching,
|
||||||
refetch
|
refetch
|
||||||
} = useGetInvalidatingCacheStatus(shouldPoll);
|
} = useGetInvalidatingCacheStatus(shouldPoll);
|
||||||
const isInvalidating = Boolean(shouldPoll && !isPending && invalidationStatus);
|
const isInvalidating = Boolean(shouldPoll && (isFetching || invalidationStatus));
|
||||||
|
|
||||||
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
|
||||||
"invalidateCache"
|
"invalidateCache"
|
||||||
@@ -34,13 +34,8 @@ export const CachingPanel = () => {
|
|||||||
try {
|
try {
|
||||||
await invalidateCache({ type });
|
await invalidateCache({ type });
|
||||||
createNotification({ text: `Began invalidating ${type} cache`, type: "success" });
|
createNotification({ text: `Began invalidating ${type} cache`, type: "success" });
|
||||||
|
setShouldPoll(true);
|
||||||
handlePopUpClose("invalidateCache");
|
handlePopUpClose("invalidateCache");
|
||||||
|
|
||||||
refetch().then((v) =>
|
|
||||||
v
|
|
||||||
? setShouldPoll(true)
|
|
||||||
: createNotification({ text: "Successfully invalidated cache", type: "success" })
|
|
||||||
);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
createNotification({ text: `Failed to invalidate ${type} cache`, type: "error" });
|
createNotification({ text: `Failed to invalidate ${type} cache`, type: "error" });
|
||||||
|
|||||||
Reference in New Issue
Block a user