saved prefs working

This commit is contained in:
Chris kerr 2024-06-12 11:56:24 -04:00
parent 17839630fd
commit 2175806511

View File

@ -78,6 +78,23 @@ function updateFiatToSatsConversion(selectedCurrency) {
}
document.addEventListener('DOMContentLoaded', () => {
const satsInputElement = document.getElementById('sats-input');
const currencySelect = document.getElementById('currency-select');
const selectedCurrency = currencySelect.value;
// Initially fetch Bitcoin price in USD
updateBitcoinPrice(selectedCurrency);
updateFiatToSatsConversion(selectedCurrency)
satsInputElement.addEventListener('input', updateSatsToDollarsConversion);
currencySelect.addEventListener('change', () => {
const selectedCurrency = currencySelect.value;
updateBitcoinPrice(selectedCurrency);
updateFiatToSatsConversion(selectedCurrency);
updateSatsToDollarsConversion(selectedCurrency);
updateFiatToSatsConversion(selectedCurrency)
});
const savedTheme = (typeof Android !== 'undefined' && Android !== null) ? Android.getPreference("theme") : null;
if (savedTheme) {
document.getElementById("theme-select").value = savedTheme;