prevent sync from clearing selected tags (#7631)

* prevent sync from clearing selected tags

* improved tag selection bugfix
This commit is contained in:
Shervin Sarain
2016-06-11 19:57:20 +02:00
committed by Matteo Pagliazzi
parent 0bf7858d53
commit 539547b39e
3 changed files with 5 additions and 4 deletions

View File

@@ -80,6 +80,10 @@ angular.module('habitrpg')
_.extend(user, response.data.data); _.extend(user, response.data.data);
if (!user.filters) {
user.filters = {};
}
if (!user._wrapped) { if (!user._wrapped) {
// This wraps user with `ops`, which are functions shared both on client and mobile. When performed on client, // This wraps user with `ops`, which are functions shared both on client and mobile. When performed on client,
// they update the user in the browser and then send the request to the server, where the same operation is // they update the user in the browser and then send the request to the server, where the same operation is

View File

@@ -13,6 +13,7 @@ schema.plugin(baseModel, {
private: ['auth.local.hashed_password', 'auth.local.salt', '_cronSignature'], private: ['auth.local.hashed_password', 'auth.local.salt', '_cronSignature'],
toJSONTransform: function userToJSON (plainObj, originalDoc) { toJSONTransform: function userToJSON (plainObj, originalDoc) {
plainObj._tmp = originalDoc._tmp; // be sure to send down drop notifs plainObj._tmp = originalDoc._tmp; // be sure to send down drop notifs
delete plainObj.filters;
return plainObj; return plainObj;
}, },

View File

@@ -107,10 +107,6 @@ let schema = new Schema({
}, },
balance: {type: Number, default: 0}, balance: {type: Number, default: 0},
// Not saved on the user right now
filters: {type: Schema.Types.Mixed, default: () => {
return {};
}},
purchased: { purchased: {
ads: {type: Boolean, default: false}, ads: {type: Boolean, default: false},