mirror of
https://bitbucket.org/grumdrig/pq-web.git
synced 2026-09-29 08:44:00 -06:00
Don't cache roster so separate pq games don't stomp on each other
This commit is contained in:
committed by
Eric Fredricksen
parent
048ada9faf
commit
01f208d1a5
@@ -256,8 +256,9 @@ storage.loadRoster = function (callback) {
|
|||||||
// aight
|
// aight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
storage.games = value || {};
|
value = value || {};
|
||||||
callback(storage.games);
|
callback(value);
|
||||||
|
storage.games = value;
|
||||||
}
|
}
|
||||||
this.getItem("roster", gotItem);
|
this.getItem("roster", gotItem);
|
||||||
}
|
}
|
||||||
@@ -288,15 +289,10 @@ storage.storeRoster = function (roster, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
storage.addToRoster = function (newguy, callback) {
|
storage.addToRoster = function (newguy, callback) {
|
||||||
if (this.games) {
|
this.loadRoster(function (games) {
|
||||||
this.games[newguy.Traits.Name] = newguy;
|
games[newguy.Traits.Name] = newguy;
|
||||||
this.storeRoster(this.games, callback);
|
storage.storeRoster(games, callback);
|
||||||
} else {
|
|
||||||
this.loadRoster(function () {
|
|
||||||
if (storage.games) // should always be true
|
|
||||||
storage.addToRoster(newguy, callback);
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Number.prototype.div = function (divisor) {
|
Number.prototype.div = function (divisor) {
|
||||||
|
|||||||
Reference in New Issue
Block a user