feat(admin): enhance operations guidance and session handling
Some checks failed
lotteryadmin CI / build (push) Has been cancelled

This commit is contained in:
wchino
2026-07-22 20:53:43 +08:00
parent 98a3d0b68e
commit 85ad369cf9
55 changed files with 1477 additions and 342 deletions

View File

@@ -14,13 +14,25 @@ export function useAsyncEffect(
useEffect(() => {
let cleanup: void | (() => void);
let cancelled = false;
queueMicrotask(() => {
if (cancelled) {
return;
}
void Promise.resolve(factoryRef.current()).then((result) => {
if (cancelled) {
result?.();
return;
}
cleanup = result;
});
});
return () => {
cancelled = true;
cleanup?.();
};
// eslint-disable-next-line react-hooks/exhaustive-deps