research canvas: move the setTopic(null) reset inside the async load
ci / gates (push) Successful in 7s
ci / frontend (push) Successful in 37s
ci / rust (push) Successful in 2m58s
ci / publish (push) Successful in 2m42s
ci / e2e (push) Failing after 29m54s

Second lint pass caught the standalone setTopic(null) in the early-return
branch of the effect — still synchronous at the top of the useEffect. Fold
that guard into the async load() so every setState landing on this hook
runs inside the async wrapper.
This commit is contained in:
Omar Sobh
2026-07-06 07:04:49 -07:00
parent 1466f8aadc
commit 568d3c4b78
@@ -60,12 +60,12 @@ export function ResearchCanvas({
const [acting, setActing] = useState(false);
useEffect(() => {
if (!selectedId) {
setTopic(null);
return;
}
let alive = true;
const load = async () => {
if (!selectedId) {
if (alive) setTopic(null);
return;
}
setLoading(true);
setError(null);
try {