prefetch user metadata and other fixes

This commit is contained in:
Ren Amamiya
2023-07-04 18:07:12 +07:00
parent 6590ea29e2
commit b64ac38b8d
7 changed files with 149 additions and 31 deletions

View File

@@ -184,6 +184,15 @@ export async function createReplyNote(
);
}
// get all pubkeys in db
export async function getAllPubkeys() {
const db = await connect();
const notes: any = await db.select('SELECT DISTINCT pubkey FROM notes');
const replies: any = await db.select('SELECT DISTINCT pubkey FROM replies');
const chats: any = await db.select('SELECT DISTINCT sender_pubkey FROM chats');
return [...notes, ...replies, ...chats];
}
// get all channels
export async function getChannels() {
const db = await connect();