fixed duplicate note in newsfeed and minor fixes

This commit is contained in:
Ren Amamiya
2023-04-16 08:31:40 +07:00
parent 66e45937de
commit b778cf6198
10 changed files with 51 additions and 43 deletions
+11 -9
View File
@@ -32,15 +32,17 @@ export default function EventCollector() {
const { createPleb } = await import('@utils/bindings');
for (const tag of tags) {
const pubkey = tag[1];
const metadata: any = await fetchMetadata(pubkey);
createPleb({
pleb_id: pubkey + '-lume' + activeAccount.id.toString(),
pubkey: pubkey,
kind: 0,
metadata: metadata.content,
account_id: activeAccount.id,
}).catch(console.error);
fetchMetadata(pubkey)
.then((res: { content: string }) => {
createPleb({
pleb_id: pubkey + '-lume' + activeAccount.id.toString(),
pubkey: pubkey,
kind: 0,
metadata: res.content,
account_id: activeAccount.id,
}).catch(console.error);
})
.catch(console.error);
}
},
[activeAccount.id]