]> zoso.dev Git - nemo-wallet.git/commitdiff
Update libnemo to fix issue with skipped account indexes. Fix account JSON parsing...
authorChris Duncan <chris@zoso.dev>
Sat, 26 Oct 2024 03:47:21 +0000 (20:47 -0700)
committerChris Duncan <chris@zoso.dev>
Sat, 26 Oct 2024 03:47:21 +0000 (20:47 -0700)
app/pages/nemo-wallet.html

index 0ae3e8e4117e90f34dbb1d536f2638db6baf264e..2e86cd62806bed76b8be70e508feae35719f4e37 100644 (file)
@@ -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')
                }
 
                                                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}`)
                        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
                        }