bug: load more fix

This commit is contained in:
2023-03-28 16:41:57 +01:00
parent 465c59ea20
commit 2ccf593476
7 changed files with 71 additions and 39 deletions

View File

@ -112,11 +112,11 @@ export class NostrSystem {
OnEndOfStoredEvents(c: Connection, sub: string) {
const q = this.GetQuery(sub);
if (q) {
q.request.finished = unixNowMs();
const f = this.Feeds.get(sub);
q.eose(sub, c.Address);
const f = this.Feeds.get(q.id);
if (f) {
f.eose(c.Address);
f.loading = false;
f.loading = q.progress <= 0.5;
console.debug(`${sub} loading=${f.loading}, progress=${q.progress}`);
}
if (!q.leaveOpen) {
c.CloseReq(sub);
@ -255,8 +255,6 @@ export class NostrSystem {
this.Queries.set(rb.id, q);
const store = new type();
this.Feeds.set(rb.id, store);
store.onEose(c => console.debug(`[EOSE][${rb.id}]: ${c}`));
this.SendQuery(q);
this.#changed();
return store;