diff --git a/ng-app/src/lib/Login.svelte b/ng-app/src/lib/Login.svelte
index 765df6b..0f7f7fa 100644
--- a/ng-app/src/lib/Login.svelte
+++ b/ng-app/src/lib/Login.svelte
@@ -27,7 +27,6 @@
Backspace,
ArrowPath,
LockOpen,
- Key,
CheckCircle,
ArrowLeft,
} from "svelte-heros-v2";
@@ -122,6 +121,11 @@
let unlockWith: "pazzle" | "mnemonic" | undefined;
+ let device_name;
+
+ // TODO: @niko Implement API
+ // ng.get_device_name().then((name) => (device_name = name));
+
function order() {
step = "order";
ordered = [];
@@ -168,6 +172,7 @@
// open the wallet
try {
if (tauri_platform) {
+ // TODO @niko: Add device_name as param to open_with_* APIs
let opened_wallet =
unlockWith === "pazzle"
? await ng.wallet_open_with_pazzle(wallet, pazzle, pin_code)
@@ -191,6 +196,7 @@
wallet: opened_wallet,
id: opened_wallet.V0.wallet_id,
trusted,
+ device_name,
});
} else {
let worker_import = await import("../worker.js?worker&inline");
@@ -211,9 +217,14 @@
//console.log("Message received from worker", msg.data);
if (msg.data.loaded) {
if (unlockWith === "pazzle") {
- myWorker.postMessage({ wallet, pazzle, pin_code });
+ myWorker.postMessage({ wallet, pazzle, pin_code, device_name });
} else {
- myWorker.postMessage({ wallet, mnemonic_words, pin_code });
+ myWorker.postMessage({
+ wallet,
+ mnemonic_words,
+ pin_code,
+ device_name,
+ });
}
//console.log("postMessage");
} else if (msg.data.success) {
@@ -233,6 +244,7 @@
wallet: msg.data.success,
id: msg.data.success.V0.wallet_id,
trusted,
+ device_name,
});
} else {
console.error(msg.data.error);
@@ -387,13 +399,28 @@
+ {@html $t( + "pages.wallet_create.save_wallet_options.device_name_description" + )} +
+ + {/if}{@html $t( diff --git a/ng-app/src/store.ts b/ng-app/src/store.ts index fd477dc..67cc08e 100644 --- a/ng-app/src/store.ts +++ b/ng-app/src/store.ts @@ -454,7 +454,7 @@ export const branch_subs = function(nuri) { }; let blob_cache = {}; -export async function get_blob(ref: { nuri: string | number; reference: { key: any; id: any; }; }) { +export async function get_blob(ref: { nuri: string; reference: { key: any; id: any; }; }) { if (!ref) return false; const cached = blob_cache[ref.nuri]; if (cached) {