mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-12 23:08:35 +00:00
inital commit to add confirmation to animalEars (#9666)
This commit is contained in:
parent
acf4b4da63
commit
4576353f26
2 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue