Fix hydrateEvents in streaming
This commit is contained in:
parent
d3a7f0849f
commit
477ee8b124
|
@ -68,15 +68,16 @@ const streamingController: AppController = (c) => {
|
||||||
if (!filter) return;
|
if (!filter) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const store = await Storages.pubsub();
|
const db = await Storages.db();
|
||||||
|
const pubsub = await Storages.pubsub();
|
||||||
|
|
||||||
for await (const msg of store.req([filter], { signal: controller.signal })) {
|
for await (const msg of pubsub.req([filter], { signal: controller.signal })) {
|
||||||
if (msg[0] === 'EVENT') {
|
if (msg[0] === 'EVENT') {
|
||||||
const event = msg[2];
|
const event = msg[2];
|
||||||
|
|
||||||
await hydrateEvents({
|
await hydrateEvents({
|
||||||
events: [event],
|
events: [event],
|
||||||
store,
|
store: db,
|
||||||
signal: AbortSignal.timeout(1000),
|
signal: AbortSignal.timeout(1000),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ async function renderStatuses(c: AppContext, filters: NostrFilter[]) {
|
||||||
return renderReblog(event, { viewerPubkey });
|
return renderReblog(event, { viewerPubkey });
|
||||||
}
|
}
|
||||||
return renderStatus(event, { viewerPubkey });
|
return renderStatus(event, { viewerPubkey });
|
||||||
}))).filter((boolean) => boolean);
|
}))).filter(Boolean);
|
||||||
|
|
||||||
if (!statuses.length) {
|
if (!statuses.length) {
|
||||||
return c.json([]);
|
return c.json([]);
|
||||||
|
|
Loading…
Reference in New Issue