mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
WIP: Improve User model performances (#10832)
* wip: define items as mixed objects * add default owned gear * mark modified * more mark modified * more mark modified * more mark modified * more mark modified * fix common tests * fix common tests * update mongoose * add itemsUtils * use new util function in hall controller * add tests for items utils * update website/server to mark all items as modified * start updating common code * update login incentives * update unlock * remove changes to package-lock.json * remove changes to package.json
This commit is contained in:
@@ -125,6 +125,8 @@ function _setUpNewUser (user) {
|
||||
let iterableFlags = user.flags.toObject();
|
||||
|
||||
user.items.quests.dustbunnies = 1;
|
||||
user.markModified('items.quests');
|
||||
|
||||
user.purchased.background.violet = true;
|
||||
user.preferences.background = 'violet';
|
||||
|
||||
@@ -217,6 +219,7 @@ schema.pre('save', true, function preSaveUser (next, done) {
|
||||
// automatically granted an item during a certain time period:
|
||||
// if (!this.items.pets['JackOLantern-Base'] && moment().isBefore('2014-11-01'))
|
||||
// this.items.pets['JackOLantern-Base'] = 5;
|
||||
// this.markModified('items.pets');
|
||||
}
|
||||
|
||||
// Filter notifications, remove unvalid and not necessary, handle the ones that have special requirements
|
||||
|
||||
Reference in New Issue
Block a user