fix: overload

This commit is contained in:
reya
2024-10-31 10:25:00 +07:00
parent 9b02ab5842
commit 043cabfd4e
4 changed files with 105 additions and 39 deletions
+7 -2
View File
@@ -42,11 +42,16 @@ function Screen() {
const unlisten = getCurrentWindow().listen<string>(
"metadata",
async (data) => {
const payload = data.payload;
const event: NostrEvent = JSON.parse(payload);
const event: NostrEvent = JSON.parse(data.payload);
const metadata: Metadata = JSON.parse(event.content);
// Update query cache
queryClient.setQueryData(["profile", event.pubkey], () => metadata);
// Reset query cache
await queryClient.invalidateQueries({
queryKey: ["profile", event.pubkey],
});
},
);