--If external APIs fail and there is already a currency other than BTC is selected it'll default to BTC
This commit is contained in:
sairaj mote 2023-02-19 00:41:30 +05:30
parent 94e48dcd6b
commit 26b21597de

View File

@ -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');