diff --git a/apps/desktop/src/routes/auth/create.tsx b/apps/desktop/src/routes/auth/create.tsx
index 8cb8caa1..f51616a7 100644
--- a/apps/desktop/src/routes/auth/create.tsx
+++ b/apps/desktop/src/routes/auth/create.tsx
@@ -9,11 +9,12 @@ import NDK, {
NDKPrivateKeySigner,
} from "@nostr-dev-kit/ndk";
import * as Select from "@radix-ui/react-select";
-import { downloadDir } from "@tauri-apps/api/path";
+import { desktopDir } from "@tauri-apps/api/path";
import { Window } from "@tauri-apps/api/window";
import { save } from "@tauri-apps/plugin-dialog";
import { writeTextFile } from "@tauri-apps/plugin-fs";
import { useSetAtom } from "jotai";
+import { nanoid } from "nanoid";
import { getPublicKey, nip19 } from "nostr-tools";
import { useState } from "react";
import { useForm } from "react-hook-form";
@@ -66,18 +67,20 @@ export function CreateAccountScreen() {
ark.updateNostrSigner({ signer });
- const downloadPath = await downloadDir();
- const fileName = `nostr_keys_${new Date().getTime().toString(36)}.txt`;
+ const downloadPath = await desktopDir();
+ const fileName = `nostr_keys_${nanoid(4)}.txt`;
const filePath = await save({
defaultPath: `${downloadPath}/${fileName}`,
});
- if (filePath) {
- await writeTextFile(
- filePath,
- `Nostr account, generated by Lume (lume.nu)\nPublic key: ${npub}\nPrivate key: ${nsec}`,
- );
- } // else { user cancel action }
+ if (!filePath) {
+ return toast.info("You need to save account keys before continue.");
+ }
+
+ await writeTextFile(
+ filePath,
+ `Nostr Account\nGenerated by Lume (lume.nu)\n---\nPublic key: ${npub}\nPrivate key: ${nsec}`,
+ );
await storage.createAccount({
pubkey: pubkey,
@@ -180,8 +183,8 @@ export function CreateAccountScreen() {
Let's get you set up on Nostr.
- With an account on Nostr, you'll be able to travel across all nostr
- clients, all your data are synced.
+ Get started with familiar way, but all data belong to you and you
+ have ability controls everything.