This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,36 @@
// Metro module 13911 (f13912).
import { useRef, useEffect } from "react";
import FamilyCenterStore from "../FamilyCenterStore";
import { usePendingRequestCount } from "./useUserLinks";
import { useStateFromStores } from "../../../_bundle/Module589";
import useMountEffect from "../../../hooks/useMountEffect";
import FamilyCenterActionCreators from "../FamilyCenterActionCreators";
export default function useOnNewPendingRequest(a0) {
let ref, ref2;
const current = a0;
const pendingRequestCount = usePendingRequestCount();
const stateFromStores = useStateFromStores([FamilyCenterStore], () => FamilyCenterStore.getAreLinkedUsersProcessed());
useMountEffect(() => {
if (!FamilyCenterStore.getAreLinkedUsersProcessed()) {
FamilyCenterActionCreators.fetchLinkedUsers().catch(() => {});
}
});
ref = useRef(a0);
useEffect(() => {
ref.current = current;
}, [a0]);
ref2 = useRef(null);
useEffect(() => {
if (stateFromStores) {
if (ref2.current != null) {
const r8 = pendingRequestCount > ref2.current;
ref2.current = pendingRequestCount;
if (r8) {
ref.current();
}
} else {
ref2.current = pendingRequestCount;
}
}
}, [stateFromStores, pendingRequestCount]);
};