Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
Updated Currency select on first start
  • Loading branch information
cookie0o authored Mar 26, 2024
1 parent ee77bd8 commit 9ea989a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions settingsPage/js/script.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
// Save XMR address
if (localStorage.getItem("moneroXMR_address") !== null) {$("textarea#xmraddress").val(localStorage.getItem("moneroXMR_address"))}
if (localStorage.getItem("moneroXMR_address") !== null) {$("textarea#xmraddress").val(localStorage.getItem("moneroXMR_address"))};


function UpdateAddress() {
localStorage.setItem("moneroXMR_address", $(this).val());
}
};
document.getElementById('xmraddress').addEventListener('input', UpdateAddress);

$("#currencySelect").on("change", function() {
localStorage.setItem("currency", $(this).val());
// force XMR Price update
localStorage.setItem("ForcePriceUpdate", true);
});

// Save Currency Code
if (localStorage.getItem("currency") !== null) {
if (localStorage.getItem("currency") !== "null") {
$("#currencySelect").val(localStorage.getItem("currency"));
} else {
$("#currencySelect").val("Euro (EUR)");
Expand All @@ -17,13 +23,6 @@ if (localStorage.getItem("currency") !== null) {
localStorage.setItem("ForcePriceUpdate", true);
}


$("#currencySelect").on("change", function() {
localStorage.setItem("currency", $(this).val());
// force XMR Price update
localStorage.setItem("ForcePriceUpdate", true);
});

// donate btn
document.getElementById('donate_btn').addEventListener('click', function() {
// open URL
Expand Down

0 comments on commit 9ea989a

Please sign in to comment.