compute social threads after the loop

This commit is contained in:
BlowaterNostr 2023-07-15 14:54:24 +00:00
parent 525e98a56a
commit 13eba08177

View File

@ -458,6 +458,7 @@ export async function* Database_Update(
changes_events.push(e);
}
let hasKind_1 = false;
for (let e of changes_events) {
model.allUsersInfo = getAllUsersInformation(database, ctx);
const t = getTags(e).lamport_timestamp;
@ -542,9 +543,12 @@ export async function* Database_Update(
}
}
} else if (e.kind == NostrKind.TEXT_NOTE) {
model.social.threads = getSocialPosts(database, model.allUsersInfo);
hasKind_1 = true;
}
}
if (hasKind_1) {
model.social.threads = getSocialPosts(database, model.allUsersInfo);
}
yield model;
}
}