From 4576353f261e5e574877f2f41c0414432601f41d Mon Sep 17 00:00:00 2001 From: Julius Jung Date: Fri, 5 Jan 2018 14:26:45 -0500 Subject: [PATCH] inital commit to add confirmation to animalEars (#9666) --- website/client/components/creatorIntro.vue | 3 +-- website/common/script/ops/unlock.js | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/website/client/components/creatorIntro.vue b/website/client/components/creatorIntro.vue index a6161a5da4..e6390a5d77 100644 --- a/website/client/components/creatorIntro.vue +++ b/website/client/components/creatorIntro.vue @@ -1050,7 +1050,6 @@ export default { return own; }, animalEars () { - // @TODO: This is not like other purchase items // @TODO: For some resonse when I use $set on the user purchases object, this is not recomputed. Hack for now let backgroundUpdate = this.backgroundUpdate; // eslint-disable-line let keys = this.animalEarsKeys; @@ -1065,7 +1064,7 @@ export default { option.locked = locked; option.click = () => { let type = this.user.preferences.costume ? 'costume' : 'equipped'; - return locked ? this.purchase('gear', newKey) : this.equip(newKey, type); + return locked ? this.unlock(`items.gear.owned.${newKey}`) : this.equip(newKey, type); }; return option; }); diff --git a/website/common/script/ops/unlock.js b/website/common/script/ops/unlock.js index 036fa9bbd7..bbe4a79109 100644 --- a/website/common/script/ops/unlock.js +++ b/website/common/script/ops/unlock.js @@ -91,6 +91,10 @@ module.exports = function unlock (user, req = {}, analytics) { // Using Object so path[1] won't create an array but an object {path: {1: value}} setWith(user, `preferences.${key}`, value, Object); } else { + if (path.indexOf('gear.') !== -1) { + // Using Object so path[1] won't create an array but an object {path: {1: value}} + setWith(user, path, true, Object); + } // Using Object so path[1] won't create an array but an object {path: {1: value}} setWith(user, `purchased.${path}`, true, Object);