From 26b21597dec8ff5f3039f40874a72bafd5e04f99 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Sun, 19 Feb 2023 00:41:30 +0530 Subject: [PATCH] bug fix --If external APIs fail and there is already a currency other than BTC is selected it'll default to BTC --- index.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 1f887f4..b755286 100644 --- a/index.html +++ b/index.html @@ -712,7 +712,12 @@ } }); getExchangeRate() + .then(() => { + selectedCurrency = localStorage.getItem('btc-wallet-currency') || 'btc' + getRef('currency_selector').value = selectedCurrency + }) .catch(e => { + selectedCurrency = 'btc' // console.error(e) getRef('currency_selector').classList.add('hidden') }).finally(() => { @@ -730,8 +735,6 @@ } }, 500); }) - selectedCurrency = localStorage.getItem('btc-wallet-currency') || 'btc' - getRef('currency_selector').value = selectedCurrency getRef('add_sender').click(); getRef('add_receiver').click(); document.querySelectorAll('.currency-symbol').forEach(el => el.innerHTML = currencyIcons[selectedCurrency]) @@ -1631,7 +1634,7 @@ console.log(txid); getRef('txid').value = txid; openPopup('txid_popup', true); - getRef('send_tx').reset() + getRef('send_tx').reset(); }).catch(error => { console.error(error) notify(`Error sending transaction \n ${error}`, 'error');