problem: fetching event sometimes fails

This commit is contained in:
gsovereignty
2024-07-29 16:52:16 +08:00
parent bd6d8e2fc6
commit fbd4532cc1

View File

@@ -11,9 +11,18 @@
$ndk.fetchEvent(productID).then((e) => {
if (e) {
productEvent = e;
} else {
let _p = $ndk.storeSubscribe([{ids:[productID] }], { subId: productID });
_p.subscribe(x=>{
if (x[0]) {
productEvent = x[0]
_p.unsubscribe()
}
})
}
});
});
</script>
{#if productEvent}