mirror of
https://github.com/edufeed-org/polloer.git
synced 2025-12-10 00:34:31 +00:00
fix reaction counter
This commit is contained in:
parent
bc23755758
commit
3c84563e1a
1 changed files with 7 additions and 10 deletions
|
|
@ -16,24 +16,21 @@
|
||||||
tags: [['e', event.id]]
|
tags: [['e', event.id]]
|
||||||
});
|
});
|
||||||
await reactionEvent.publish();
|
await reactionEvent.publish();
|
||||||
|
const r = await $ndk.fetchEvents({kinds: [7], "#e": [event.id]})
|
||||||
|
console.log("r", r)
|
||||||
|
$reactions = Array.from(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(async () => {
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
console.log('no user, logging in');
|
console.log('no user, logging in');
|
||||||
login();
|
login();
|
||||||
}
|
}
|
||||||
|
const r = await $ndk.fetchEvents({kinds: [7], "#e": [event.id]})
|
||||||
|
console.log("r", r)
|
||||||
|
$reactions = Array.from(r);
|
||||||
});
|
});
|
||||||
|
|
||||||
$effect(() => {
|
|
||||||
if ($ndkReady) {
|
|
||||||
const sub = $ndk.subscribe({ kinds: [7], '#e': [event.id] });
|
|
||||||
sub.on('event', (e) => {
|
|
||||||
$reactions = [...$reactions, e];
|
|
||||||
console.log(`${e.content}`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="w-full border p-2">
|
<div class="w-full border p-2">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue