feat: improve splash screen and notification service
This commit is contained in:
@@ -6,11 +6,7 @@ export class NostrAccount {
|
||||
const query = await commands.getAccounts();
|
||||
|
||||
if (query.status === "ok") {
|
||||
const accounts = query.data
|
||||
.split(/\s+/)
|
||||
.filter((v) => v.startsWith("npub1"));
|
||||
|
||||
return [...new Set(accounts)];
|
||||
return query.data;
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export const commands = {
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getAccounts(): Promise<Result<string, string>> {
|
||||
async getAccounts(): Promise<Result<string[], string>> {
|
||||
try {
|
||||
return { status: "ok", data: await TAURI_INVOKE("get_accounts") };
|
||||
} catch (e) {
|
||||
@@ -150,17 +150,6 @@ export const commands = {
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async runNotification(accounts: string[]): Promise<Result<null, null>> {
|
||||
try {
|
||||
return {
|
||||
status: "ok",
|
||||
data: await TAURI_INVOKE("run_notification", { accounts }),
|
||||
};
|
||||
} catch (e) {
|
||||
if (e instanceof Error) throw e;
|
||||
else return { status: "error", error: e as any };
|
||||
}
|
||||
},
|
||||
async getActivities(
|
||||
account: string,
|
||||
kind: string,
|
||||
|
||||
Reference in New Issue
Block a user