fix: status and groupTitle, if its not set

This commit is contained in:
Barış Soner Uşaklı
2019-07-19 19:39:57 -04:00
parent 2f0a331f02
commit e2e33dfb1e

View File

@@ -169,7 +169,7 @@ module.exports = function (User) {
user.picture = User.getDefaultAvatar(); user.picture = User.getDefaultAvatar();
} }
if (user.hasOwnProperty('status') && user.lastonline) { if (user.hasOwnProperty('status') && user.hasOwnProperty('lastonline')) {
user.status = User.getStatus(user); user.status = User.getStatus(user);
} }
@@ -215,6 +215,7 @@ module.exports = function (User) {
if (user.groupTitle) { if (user.groupTitle) {
user.groupTitleArray = [user.groupTitle]; user.groupTitleArray = [user.groupTitle];
} else { } else {
user.groupTitle = '';
user.groupTitleArray = []; user.groupTitleArray = [];
} }
} }