Permalink
Browse files

log reading bug

caused when you played best of three without a sideboard
  • Loading branch information...
Manuel-777 committed Oct 5, 2018
1 parent 896d213 commit f86a65b011624f2a70b800cda612eb92f68da687
Showing with 16 additions and 12 deletions.
  1. +16 −12 window_background/background.js
@@ -1051,14 +1051,16 @@ function processLogData(data) {
tempMain[grpId] += 1;
}
});
json.submitDeckReq.deck.sideboardCards.forEach( function (grpId) {
if (tempSide[grpId] == undefined) {
tempSide[grpId] = 1
}
else {
tempSide[grpId] += 1;
}
});
if (json.submitDeckReq.deck.sideboardCards !== undefined) {
json.submitDeckReq.deck.sideboardCards.forEach( function (grpId) {
if (tempSide[grpId] == undefined) {
tempSide[grpId] = 1
}
else {
tempSide[grpId] += 1;
}
});
}
// Update on overlay
var str = JSON.stringify(currentDeck);
@@ -1072,10 +1074,12 @@ function processLogData(data) {
});
currentDeck.sideboard = [];
Object.keys(tempSide).forEach(function(key) {
var c = {"id": key, "quantity": tempSide[key]};
currentDeck.sideboard.push(c);
});
if (json.submitDeckReq.deck.sideboardCards !== undefined) {
Object.keys(tempSide).forEach(function(key) {
var c = {"id": key, "quantity": tempSide[key]};
currentDeck.sideboard.push(c);
});
}
//console.log(JSON.stringify(currentDeck));
//console.log(currentDeck);

0 comments on commit f86a65b

Please sign in to comment.