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));
|
||||
|
||||
@@ -3,8 +3,8 @@ export function CancelIcon(props: JSX.IntrinsicElements["svg"]) {
|
||||
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" {...props}>
|
||||
<path
|
||||
stroke="currentColor"
|
||||
stroke-linecap="round"
|
||||
stroke-width="2"
|
||||
strokeLinecap="round"
|
||||
strokeWidth="2"
|
||||
d="m5 5 14 14m0-14L5 19"
|
||||
/>
|
||||
</svg>
|
||||
|
||||
Reference in New Issue
Block a user