feat: simplify account management
This commit is contained in:
@@ -25,7 +25,7 @@ export class Ark {
|
||||
const cmd: string[] = await invoke("get_all_nsecs");
|
||||
|
||||
for (const item of cmd) {
|
||||
accounts.push({ npub: item.replace(".nsec", "") });
|
||||
accounts.push({ npub: item.replace(".npub", "") });
|
||||
}
|
||||
|
||||
this.accounts = accounts;
|
||||
@@ -37,9 +37,8 @@ export class Ark {
|
||||
|
||||
public async load_selected_account(npub: string) {
|
||||
try {
|
||||
const fullNpub = `${npub}.nsec`;
|
||||
const cmd: boolean = await invoke("load_selected_account", {
|
||||
npub: fullNpub,
|
||||
npub,
|
||||
});
|
||||
|
||||
return cmd;
|
||||
@@ -75,10 +74,6 @@ export class Ark {
|
||||
password,
|
||||
});
|
||||
|
||||
if (cmd) {
|
||||
await invoke("update_signer", { nsec });
|
||||
}
|
||||
|
||||
return cmd;
|
||||
} catch (e) {
|
||||
throw new Error(String(e));
|
||||
|
||||
Reference in New Issue
Block a user