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 (
{error.statusText || error.message}
While waiting for Lume's Devs to release the bug fixes, you always can use other Nostr clients with your account: