From 01f208d1a5c92a1c568631c4b2c70bed8f48d69c Mon Sep 17 00:00:00 2001 From: Eric Fredricksen Date: Thu, 9 Dec 2021 11:18:12 -0800 Subject: [PATCH] Don't cache roster so separate pq games don't stomp on each other --- config.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/config.js b/config.js index 668efb3..a438080 100644 --- a/config.js +++ b/config.js @@ -256,8 +256,9 @@ storage.loadRoster = function (callback) { // aight } } - storage.games = value || {}; - callback(storage.games); + value = value || {}; + callback(value); + storage.games = value; } this.getItem("roster", gotItem); } @@ -288,15 +289,10 @@ storage.storeRoster = function (roster, callback) { } storage.addToRoster = function (newguy, callback) { - if (this.games) { - this.games[newguy.Traits.Name] = newguy; - this.storeRoster(this.games, callback); - } else { - this.loadRoster(function () { - if (storage.games) // should always be true - storage.addToRoster(newguy, callback); - }); - } + this.loadRoster(function (games) { + games[newguy.Traits.Name] = newguy; + storage.storeRoster(games, callback); + }); } Number.prototype.div = function (divisor) {