Skip to content

Commit

Permalink
Added local storage of gear changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lologarithm committed Apr 4, 2021
1 parent d7e4e5d commit 905509c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions ui/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,18 @@ function popgear() {
}
});

// TODO: make this store in like local storage or something so people cache gear choices.
var finger1done = false;
var trink1done = false;
defaultGear.forEach(inm => {
var glist = [];
// TODO: make this store in like local storage or something so people cache gear choices.
var gearCache = localStorage.getItem('cachedGear');
if (gearCache) {
glist = JSON.parse(gearCache);
} else {
glist = defaultGear;
}

glist.forEach(inm => {
var item = allgear[inm];
var slotid = slotToID[item.slot];

Expand Down Expand Up @@ -332,6 +340,7 @@ function updateGear(newGear) {
});

currentGear = newGear;
localStorage.setItem("cachedGear", JSON.stringify(gearlist));

var gearjson = gearstats(gearlist);
var gearParse = JSON.parse(gearjson);
Expand Down

0 comments on commit 905509c

Please sign in to comment.