fix: cannot import ncryptsec

This commit is contained in:
reya
2024-08-29 07:48:26 +07:00
parent d128af1db8
commit 74d8bf2ead
3 changed files with 27 additions and 23 deletions

View File

@@ -56,7 +56,7 @@ async createAccount(name: string, about: string, picture: string, password: stri
else return { status: "error", error: e as any };
}
},
async importAccount(key: string, password: string | null) : Promise<Result<string, string>> {
async importAccount(key: string, password: string) : Promise<Result<string, string>> {
try {
return { status: "ok", data: await TAURI_INVOKE("import_account", { key, password }) };
} catch (e) {

View File

@@ -95,13 +95,15 @@ function Screen() {
</button>
</div>
</div>
{key.length && !key.startsWith("ncryptsec") ? (
{key.length ? (
<div className="flex flex-col gap-1">
<label
htmlFor="password"
className="text-sm font-medium text-neutral-800 dark:text-neutral-200"
>
Set password to secure your key
{!key.startsWith("ncryptsec")
? "Set password to secure your key"
: "Enter password to decrypt your key"}
</label>
<input
name="password"