}); //loadJSON
- base = 'USD';
+ base = settings.get('user.currency'); // get the user's base currency
+ var currSel = document.getElementById('base'); //select the currency select box
+ currSel.value = settings.get('user.currency'); //select the option that corresponds to the user's currency
setBase = function() {
//selected base currency
- var x = document.getElementById("base").selectedIndex;
- var y = document.getElementById("base").options;
- base = y[x].text;
+ var sel = document.getElementById('base');
+ var x = sel.selectedIndex;
+ var y = sel.options;
+ base = y[x].text;
+ settings.set('user.currency', base); //save the user's selection
+ updateData(); //immediately reflect the changed currency
};
})();
@@ -493,21 +521,7 @@
Tip Jar
return parent.appendChild(el);
}
- //user settings
- const settings = require('electron-settings');
- settings.set('developer', {
- first: 'Nathan',
- last: 'Parikh'
- });
- //default coins
- if(settings.has('user.coins')) {
- //do nothing because coins already set
- }
- else {
- settings.set('user', {
- coins: 'BTC,ETH,LTC'
- });
- }
+
// Returns an array with values of the selected (checked) checkboxes in "frm"
function getSelectedChbox(frm) {