mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
inital commit to add confirmation to animalEars (#9666)
This commit is contained in:
@@ -1050,7 +1050,6 @@ export default {
|
|||||||
return own;
|
return own;
|
||||||
},
|
},
|
||||||
animalEars () {
|
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
|
// @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 backgroundUpdate = this.backgroundUpdate; // eslint-disable-line
|
||||||
let keys = this.animalEarsKeys;
|
let keys = this.animalEarsKeys;
|
||||||
@@ -1065,7 +1064,7 @@ export default {
|
|||||||
option.locked = locked;
|
option.locked = locked;
|
||||||
option.click = () => {
|
option.click = () => {
|
||||||
let type = this.user.preferences.costume ? 'costume' : 'equipped';
|
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;
|
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}}
|
// Using Object so path[1] won't create an array but an object {path: {1: value}}
|
||||||
setWith(user, `preferences.${key}`, value, Object);
|
setWith(user, `preferences.${key}`, value, Object);
|
||||||
} else {
|
} 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}}
|
// Using Object so path[1] won't create an array but an object {path: {1: value}}
|
||||||
setWith(user, `purchased.${path}`, true, Object);
|
setWith(user, `purchased.${path}`, true, Object);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user