diff --git a/ng-app/src/api.ts b/ng-app/src/api.ts index ffd3c18..98ff106 100644 --- a/ng-app/src/api.ts +++ b/ng-app/src/api.ts @@ -72,6 +72,7 @@ const handler = { } } else { let tauri = await import("@tauri-apps/api/tauri"); + try { if (path[0] === "client_info") { let from_rust = await tauri.invoke("client_info_rust",{}); @@ -166,6 +167,15 @@ const handler = { } return res || {}; + } else if (path[0] === "wallet_import_from_code") { + let arg = {}; + args.map((el,ix) => arg[mapping[path[0]][ix]]=el); + let res = await tauri.invoke(path[0],arg); + if (res) { + res.V0.content.security_img = Uint8Array.from(res.V0.content.security_img); + } + return res || {}; + } else if (path[0] === "upload_chunk") { let session_id = args[0]; let upload_id = args[1]; @@ -202,8 +212,11 @@ const handler = { } else { let arg = {}; args.map((el,ix) => arg[mapping[path[0]][ix]]=el) - return tauri.invoke(path[0],arg) + return await tauri.invoke(path[0],arg) } + }catch (e) { + throw JSON.parse(e); + } } }, }; diff --git a/ng-app/src/routes/WalletInfo.svelte b/ng-app/src/routes/WalletInfo.svelte index d5bf7b4..5375abd 100644 --- a/ng-app/src/routes/WalletInfo.svelte +++ b/ng-app/src/routes/WalletInfo.svelte @@ -475,9 +475,15 @@
-
+
{@html $t("pages.wallet_info.scan_qr.scan_successful")}
+ {/if} {/if} diff --git a/ng-app/src/routes/WalletLogin.svelte b/ng-app/src/routes/WalletLogin.svelte index a4ae56d..e87a0c9 100644 --- a/ng-app/src/routes/WalletLogin.svelte +++ b/ng-app/src/routes/WalletLogin.svelte @@ -123,7 +123,7 @@ wallet_from_import.set(null); }); async function gotError(event) { - importing = false; + //importing = false; console.error(event.detail); } async function gotWallet(event) { @@ -189,6 +189,7 @@ } else { wallet = $wallets[selected]?.wallet; } + importing = false; } function handleWalletUpload(event) { const files = event.target.files; diff --git a/ng-app/src/routes/WalletLoginTextCode.svelte b/ng-app/src/routes/WalletLoginTextCode.svelte index 5fe63a4..38c6982 100644 --- a/ng-app/src/routes/WalletLoginTextCode.svelte +++ b/ng-app/src/routes/WalletLoginTextCode.svelte @@ -85,7 +85,6 @@ {#if error}
-

{@html $t("errors.error_occurred", { values: { message: display_error(error) }, diff --git a/ng-app/src/store.ts b/ng-app/src/store.ts index 64f3e07..3927cf3 100644 --- a/ng-app/src/store.ts +++ b/ng-app/src/store.ts @@ -46,7 +46,6 @@ init({ export const display_error = (error: string) => { // Check, if error tranlsation does not exist const parts = error.split(":"); - let res = get(format)("errors." + parts[0]); if (parts[1]) { res += " " + get(format)("errors." + parts[1]);