Skip to content

Commit

Permalink
improve loading of preferences
Browse files Browse the repository at this point in the history
As suggested by Wolfgang in #335 (review)
  • Loading branch information
joewiz committed Nov 13, 2021
1 parent 49888db commit 5f4b11c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ eXide.util.Preferences = (function () {
Constr.prototype.read = function() {
var sameVersion = false;
if (localStorage["eXide.preferences"]) {
this.preferences = Object.assign(defaultPreferences, JSON.parse(localStorage.getItem("eXide.preferences")));
sameVersion = (this.preferences.version === eXide.app.version());
const loaded = JSON.parse(localStorage.getItem("eXide.preferences"));
this.preferences = Object.assign({}, defaultPreferences, loaded);
}

this.preferences.version = eXide.app.version();
Expand Down

0 comments on commit 5f4b11c

Please sign in to comment.