[High] refreshAssets useCallback defeats polling effect, causes timer drift #42
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
File: screens-library.jsx:59-88
Severity: High
PROJECTS is re-read from window.ZAMPP_DATA every render, creating a new array reference. The useCallback depends on [PROJECTS], so refreshAssets is a new function on every render. The polling useEffect cleans up and re-registers the interval on every render, causing timer drift.
Fix: Use window.ZAMPP_DATA.PROJECTS directly inside the callback and remove the dependency, or stabilize the ref with useMemo.