bug: thread sub loop

This commit is contained in:
Kieran 2023-01-21 16:18:44 +00:00
parent d66f9ab18d
commit bd2417cda0
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 9 additions and 4 deletions

View File

@ -13,8 +13,13 @@ export default function useThreadFeed(id: u256) {
function addId(id: u256[]) {
setTrackingEvent((s) => {
let tmp = new Set([...s, ...id]);
return Array.from(tmp);
let orig = new Set(s);
if (!id.some(a => orig.has(a))) {
let tmp = new Set([...s, ...id]);
return Array.from(tmp);
} else {
return s;
}
})
}
@ -45,5 +50,5 @@ export default function useThreadFeed(id: u256) {
return () => clearTimeout(t);
}, [main.store]);
return main;
return main.store;
}

View File

@ -8,5 +8,5 @@ export default function EventPage() {
const id = parseId(params.id!);
const thread = useThreadFeed(id);
return <Thread notes={thread.store.notes} this={id} />;
return <Thread notes={thread.notes} this={id} />;
}