Skip to content

Commit

Permalink
v8.3.13-dev.2 Game Categories: fix bug that duplicates original CV ca…
Browse files Browse the repository at this point in the history
…tegory when there are multiple giveaways for the same game (close #1364)
  • Loading branch information
Rafael committed May 21, 2019
1 parent 274ca7a commit b9df36d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -53,7 +53,7 @@
"webpack-shell-plugin": "0.5.0",
"webpack-cli": "^3.1.0"
},
"devVersion": "8.3.13-dev.1",
"devVersion": "8.3.13-dev.2",
"homepage": "https://github.com/gsrafael01/ESGST",
"keywords": [
"esgst",
Expand Down
5 changes: 3 additions & 2 deletions src/modules/Games/GameCategories.js
Expand Up @@ -3198,6 +3198,7 @@ class GamesGameCategories extends Module {
cannotCheckOwnership = true;
}
for (i = 0, n = games.length; i < n; ++i) {
let currentElements = [...elements];
const button = (games[i].elgbButton && games[i].elgbButton.firstElementChild) || shared.esgst.enterGiveawayButton;
if (button && cannotCheckOwnership && gSettings.gc_e) {
button.title = `ESGST cannot check ownership of this game`;
Expand Down Expand Up @@ -3246,7 +3247,7 @@ class GamesGameCategories extends Module {
original = `fcv`;
}
if (original) {
elements.push({
currentElements.push({
attributes: {
class: `esgst-gc esgst-gc-originalCV`,
[`data-draggable-id`]: `gc_ocv`,
Expand All @@ -3270,7 +3271,7 @@ class GamesGameCategories extends Module {
}
}
}
createElements(panel, `inner`, elements);
createElements(panel, `inner`, currentElements);
if (!gSettings.gc_lp || (!gSettings.gc_lp_gv && games[i].grid)) {
for (j = panel.children.length - 1; j > -1; --j) {
panel.children[j].removeAttribute(`href`);
Expand Down

0 comments on commit b9df36d

Please sign in to comment.