mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-28 15:56:39 +00:00
♻️ invalidate everything & fix use effect condition
This commit is contained in:
@@ -217,7 +217,7 @@ export default function ResourceAuthenticationPage() {
|
|||||||
const hasInitializedRef = useRef(false);
|
const hasInitializedRef = useRef(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!pageLoading || hasInitializedRef.current) return;
|
if (pageLoading || hasInitializedRef.current) return;
|
||||||
|
|
||||||
usersRolesForm.setValue(
|
usersRolesForm.setValue(
|
||||||
"roles",
|
"roles",
|
||||||
@@ -307,6 +307,17 @@ export default function ResourceAuthenticationPage() {
|
|||||||
title: t("resourceAuthSettingsSave"),
|
title: t("resourceAuthSettingsSave"),
|
||||||
description: t("resourceAuthSettingsSaveDescription")
|
description: t("resourceAuthSettingsSaveDescription")
|
||||||
});
|
});
|
||||||
|
await queryClient.invalidateQueries({
|
||||||
|
predicate(query) {
|
||||||
|
const resourceKey = resourceQueries.resourceClients({
|
||||||
|
resourceId: resource.resourceId
|
||||||
|
}).queryKey;
|
||||||
|
return (
|
||||||
|
query.queryKey[0] === resourceKey[0] &&
|
||||||
|
query.queryKey[1] === resourceKey[1]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
router.refresh();
|
router.refresh();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user