import { useArk } 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"; import { relaunch } from "@tauri-apps/plugin-process"; import { useRouteError } from "react-router-dom"; interface RouteError { statusText: string; message: string; } export function ErrorScreen() { const ark = useArk(); const storage = useStorage(); const error = useRouteError() as RouteError; const restart = async () => { await relaunch(); }; const download = async () => { try { const downloadPath = await downloadDir(); const fileName = `nostr_keys_${new Date().toISOString()}.txt`; const filePath = await save({ defaultPath: `${downloadPath}/${fileName}`, }); const nsec = await storage.loadPrivkey(ark.account.pubkey); if (filePath) { if (nsec) { await writeTextFile( filePath, `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: ${ark.account.id}`, ); } } // else { user cancel action } } catch (e) { await message(e, { title: "Cannot download account keys", type: "error", }); } }; return (
{error.statusText || error.message}
While waiting for Lume release the bug fixes, you always can use other Nostr clients with your account: