research canvas: move the setTopic(null) reset inside the async load
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user