Skip to content

Commit

Permalink
Merge 43c9e4f into ef412c7
Browse files Browse the repository at this point in the history
  • Loading branch information
negue committed Feb 8, 2019
2 parents ef412c7 + 43c9e4f commit 0da8542
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
2 changes: 2 additions & 0 deletions website/client/components/shops/seasonal/index.vue
Expand Up @@ -388,7 +388,9 @@
},
seasonal () {
// vue subscriptions, don't remove
let backgroundUpdate = this.backgroundUpdate; // eslint-disable-line
const myUserVersion = this.user._v; // eslint-disable-line
let seasonal = shops.getSeasonalShop(this.user);
Expand Down
30 changes: 8 additions & 22 deletions website/common/script/ops/pinnedGearUtils.js
Expand Up @@ -85,30 +85,16 @@ function removePinnedGearByClass (user) {
}

function removePinnedGearAddPossibleNewOnes (user, itemPath, newItemKey) {
let currentPinnedItems = selectGearToPin(user);
let removeAndAddAllItems = false;

for (let item of currentPinnedItems) {
let itemInfo = getItemInfo(user, 'marketGear', item);

if (itemInfo.path === itemPath) {
removeAndAddAllItems = true;
break;
}
}

removeItemByPath(user, itemPath);

if (removeAndAddAllItems) {
// an item of the users current "new" gear was bought
// remove the old pinned gear items and add the new gear back
removePinnedGearByClass(user);
user.items.gear.owned[newItemKey] = true;
addPinnedGearByClass(user);
} else {
// just change the new gear to owned
user.items.gear.owned[newItemKey] = true;
}
// an item of the users current "new" gear was bought
// remove the old pinned gear items and add the new gear back
removePinnedGearByClass(user);
user.items.gear.owned[newItemKey] = true;
addPinnedGearByClass(user);

// update the version, so that vue can refresh the seasonal shop
user._v++;
}

/**
Expand Down

0 comments on commit 0da8542

Please sign in to comment.