feat: refactor
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useStorage } from "@lume/ark";
|
||||
import { useStorage } from "@lume/storage";
|
||||
import { downloadDir } from "@tauri-apps/api/path";
|
||||
import { message, save } from "@tauri-apps/plugin-dialog";
|
||||
import { writeTextFile } from "@tauri-apps/plugin-fs";
|
||||
@@ -25,18 +25,18 @@ export function ErrorScreen() {
|
||||
const filePath = await save({
|
||||
defaultPath: `${downloadPath}/${fileName}`,
|
||||
});
|
||||
const nsec = await storage.loadPrivkey(storage.account.pubkey);
|
||||
const nsec = await storage.loadPrivkey(ark.account.pubkey);
|
||||
|
||||
if (filePath) {
|
||||
if (nsec) {
|
||||
await writeTextFile(
|
||||
filePath,
|
||||
`Nostr account, generated by Lume (lume.nu)\nPublic key: ${storage.account.id}\nPrivate key: ${nsec}`,
|
||||
`Nostr account, generated by Lume (lume.nu)\nPublic key: ${ark.account.id}\nPrivate key: ${nsec}`,
|
||||
);
|
||||
} else {
|
||||
await writeTextFile(
|
||||
filePath,
|
||||
`Nostr account, generated by Lume (lume.nu)\nPublic key: ${storage.account.id}`,
|
||||
`Nostr account, generated by Lume (lume.nu)\nPublic key: ${ark.account.id}`,
|
||||
);
|
||||
}
|
||||
} // else { user cancel action }
|
||||
|
||||
Reference in New Issue
Block a user