From ddabfb4105714f0f4c27dd5fdbb2d744a8080416 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Fri, 25 Oct 2024 20:47:21 -0700 Subject: [PATCH] Update libnemo to fix issue with skipped account indexes. Fix account JSON parsing. Issue now is that accounts are being duplicated when creating or loading a new wallet. --- app/pages/nemo-wallet.html | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/app/pages/nemo-wallet.html b/app/pages/nemo-wallet.html index 0ae3e8e..2e86cd6 100644 --- a/app/pages/nemo-wallet.html +++ b/app/pages/nemo-wallet.html @@ -34,7 +34,7 @@ async function loadNemo () { console.log('loading libnemo') - libnemo = await import('https://cdn.jsdelivr.net/npm/libnemo@0.0.13') + libnemo = await import('https://cdn.jsdelivr.net/npm/libnemo@0.0.14/dist/main.min.js') console.log('loaded libnemo') } @@ -346,10 +346,7 @@ oldOption.remove() } } - const newOptions = options.map(o => new Option(o.text, o.value)) - if (newOptions.length > 0) { - select.add(...newOptions) - } + options.map(o => select.add(new Option(o.text, o.value))) } catch (err) { console.error(err) notify.error(`Error resetting options for select ${id}`) @@ -360,10 +357,8 @@ walletSelect = document.getElementById('wallet') if (walletSelect?.value) { const accounts = await getFromStorage('accounts') - const accountData = accounts.filter(a => { - console.log(JSON.parse(a)) - const { walletId } = JSON.parse(a) - return walletId === walletSelect.value + const accountData = accounts.map(a => JSON.parse(a)).filter(a => { + return a.walletId === walletSelect.value }) return accountData } -- 2.34.1