bug: thread sub loop
This commit is contained in:
@ -13,8 +13,13 @@ export default function useThreadFeed(id: u256) {
|
|||||||
|
|
||||||
function addId(id: u256[]) {
|
function addId(id: u256[]) {
|
||||||
setTrackingEvent((s) => {
|
setTrackingEvent((s) => {
|
||||||
let tmp = new Set([...s, ...id]);
|
let orig = new Set(s);
|
||||||
return Array.from(tmp);
|
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);
|
return () => clearTimeout(t);
|
||||||
}, [main.store]);
|
}, [main.store]);
|
||||||
|
|
||||||
return main;
|
return main.store;
|
||||||
}
|
}
|
@ -8,5 +8,5 @@ export default function EventPage() {
|
|||||||
const id = parseId(params.id!);
|
const id = parseId(params.id!);
|
||||||
const thread = useThreadFeed(id);
|
const thread = useThreadFeed(id);
|
||||||
|
|
||||||
return <Thread notes={thread.store.notes} this={id} />;
|
return <Thread notes={thread.notes} this={id} />;
|
||||||
}
|
}
|
Reference in New Issue
Block a user