fix: thread not reload after reply
This commit is contained in:
@@ -183,7 +183,6 @@ function ReplyList() {
|
||||
"event",
|
||||
async (data) => {
|
||||
const event = LumeEvent.from(data.payload.raw, data.payload.parsed);
|
||||
console.log(event);
|
||||
|
||||
await queryClient.setQueryData(
|
||||
["replies", id],
|
||||
@@ -200,6 +199,16 @@ function ReplyList() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const unlisten = getCurrentWindow().listen(id, async () => {
|
||||
await queryClient.invalidateQueries({ queryKey: ["replies", id] });
|
||||
});
|
||||
|
||||
return () => {
|
||||
unlisten.then((f) => f());
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="px-3">
|
||||
<div className="flex items-center text-sm font-semibold h-14 text-neutral-600 dark:text-white/30">
|
||||
|
||||
Reference in New Issue
Block a user