feat: add user screen

This commit is contained in:
2024-02-27 13:42:59 +07:00
parent 98ef1927f2
commit 2403231ac4
9 changed files with 173 additions and 31 deletions

View File

@@ -99,6 +99,23 @@ export class Ark {
}
}
public async get_events_from(id: string, limit: number, asOf?: number) {
try {
let until: string = undefined;
if (asOf && asOf > 0) until = asOf.toString();
const nostrEvents: Event[] = await invoke("get_events_from", {
id,
limit,
until,
});
return nostrEvents.sort((a, b) => b.created_at - a.created_at);
} catch {
return [];
}
}
public async get_events(
type: "local" | "global",
limit: number,