research UI: fix 3 lint errors — async wrapper + escape apostrophe
Push right after ec1ddc6 tripped three eslint errors on the same-commit
lint pass. All three are cosmetic in behavior:
- ResearchList.tsx:48 + ResearchCanvas.tsx:64 — setState was called
synchronously at the top of a useEffect. Wrap the body in an inner
async load() and call setState inside it; effect still returns the
cleanup for the alive-flag guard.
- ResearchWizard.tsx:207 — bare apostrophe in JSX text ("workspace's").
Replace with ' to satisfy react/no-unescaped-entities.
This commit is contained in:
@@ -45,17 +45,18 @@ export function ResearchList({
|
||||
|
||||
useEffect(() => {
|
||||
let alive = true;
|
||||
setLoading(true);
|
||||
listTopics()
|
||||
.then((rows) => {
|
||||
const load = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const rows = await listTopics();
|
||||
if (alive) setTopics(rows);
|
||||
})
|
||||
.catch(() => {
|
||||
} catch {
|
||||
if (alive) setTopics([]);
|
||||
})
|
||||
.finally(() => {
|
||||
} finally {
|
||||
if (alive) setLoading(false);
|
||||
});
|
||||
}
|
||||
};
|
||||
load();
|
||||
return () => {
|
||||
alive = false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user