mirror of https://github.com/halo-dev/halo-admin
perf: improve the conditions for categories and tags automatic refresh
parent
66a626c916
commit
95c24cb38e
|
@ -34,10 +34,11 @@ export function usePostCategory(): usePostCategoryReturn {
|
||||||
return data.items;
|
return data.items;
|
||||||
},
|
},
|
||||||
refetchInterval(data) {
|
refetchInterval(data) {
|
||||||
const deletingCategories = data?.filter(
|
const abnormalCategories = data?.filter(
|
||||||
(category) => !!category.metadata.deletionTimestamp
|
(category) =>
|
||||||
|
!!category.metadata.deletionTimestamp || !category.status?.permalink
|
||||||
);
|
);
|
||||||
return deletingCategories?.length ? 3000 : false;
|
return abnormalCategories?.length ? 3000 : false;
|
||||||
},
|
},
|
||||||
refetchOnWindowFocus: false,
|
refetchOnWindowFocus: false,
|
||||||
onSuccess(data) {
|
onSuccess(data) {
|
||||||
|
|
|
@ -28,10 +28,10 @@ export function usePostTag(): usePostTagReturn {
|
||||||
return data.items;
|
return data.items;
|
||||||
},
|
},
|
||||||
refetchInterval(data) {
|
refetchInterval(data) {
|
||||||
const deletingTags = data?.filter(
|
const abnormalTags = data?.filter(
|
||||||
(tag) => !!tag.metadata.deletionTimestamp
|
(tag) => !!tag.metadata.deletionTimestamp || !tag.status?.permalink
|
||||||
);
|
);
|
||||||
return deletingTags?.length ? 3000 : false;
|
return abnormalTags?.length ? 3000 : false;
|
||||||
},
|
},
|
||||||
refetchOnWindowFocus: false,
|
refetchOnWindowFocus: false,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue