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'; import { useStorage } from '@libs/storage/provider'; interface RouteError { statusText: string; message: string; } export function ErrorScreen() { const { db } = 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 db.secureLoad(db.account.pubkey); if (filePath) { if (nsec) { await writeTextFile( filePath, `Nostr account, generated by Lume (lume.nu)\nPublic key: ${db.account.id}\nPrivate key: ${nsec}` ); } else { await writeTextFile( filePath, `Nostr account, generated by Lume (lume.nu)\nPublic key: ${db.account.id}` ); } } // else { user cancel action } } catch (e) { await message(e, { title: 'Cannot download account keys', type: 'error' }); } }; return (

Sorry, an unexpected error has occurred.

Don't panic, your account is safe.
Here are what things you can do:

1. Try to close and re-open the app
2. Backup Nostr account
3. Report this issue to Lume's Devs
Report

{error.statusText || error.message}

4. Use another Nostr client

While waiting for Lume's Devs to release the bug fixes, you always can use other Nostr clients with your account:

); }