mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 17:03:09 +02:00
Improve performance
This commit is contained in:
parent
2f7e6baa05
commit
325cd03a59
1 changed files with 11 additions and 2 deletions
|
@ -225,6 +225,7 @@ export const pack = (
|
||||||
|
|
||||||
const fields = opts.detail ? {
|
const fields = opts.detail ? {
|
||||||
} : {
|
} : {
|
||||||
|
usernameLower: false,
|
||||||
bannerColor: false,
|
bannerColor: false,
|
||||||
bannerUrl: false,
|
bannerUrl: false,
|
||||||
description: false,
|
description: false,
|
||||||
|
@ -241,7 +242,14 @@ export const pack = (
|
||||||
wallpaperColor: false,
|
wallpaperColor: false,
|
||||||
wallpaperId: false,
|
wallpaperId: false,
|
||||||
wallpaperUrl: false,
|
wallpaperUrl: false,
|
||||||
twitter: false
|
twitter: false,
|
||||||
|
pendingReceivedFollowRequestsCount: false,
|
||||||
|
featured: false,
|
||||||
|
sharedInbox: false,
|
||||||
|
endpoints: false,
|
||||||
|
inbox: false,
|
||||||
|
twoFactorTempSecret: false,
|
||||||
|
twoFactorSecret: false
|
||||||
};
|
};
|
||||||
|
|
||||||
// Populate the user if 'user' is ID
|
// Populate the user if 'user' is ID
|
||||||
|
@ -276,6 +284,8 @@ export const pack = (
|
||||||
_user.id = _user._id;
|
_user.id = _user._id;
|
||||||
delete _user._id;
|
delete _user._id;
|
||||||
|
|
||||||
|
delete _user.usernameLower;
|
||||||
|
|
||||||
if (_user.host == null) {
|
if (_user.host == null) {
|
||||||
// Remove private properties
|
// Remove private properties
|
||||||
delete _user.keypair;
|
delete _user.keypair;
|
||||||
|
@ -283,7 +293,6 @@ export const pack = (
|
||||||
delete _user.token;
|
delete _user.token;
|
||||||
delete _user.twoFactorTempSecret;
|
delete _user.twoFactorTempSecret;
|
||||||
delete _user.twoFactorSecret;
|
delete _user.twoFactorSecret;
|
||||||
delete _user.usernameLower;
|
|
||||||
if (_user.twitter) {
|
if (_user.twitter) {
|
||||||
delete _user.twitter.accessToken;
|
delete _user.twitter.accessToken;
|
||||||
delete _user.twitter.accessTokenSecret;
|
delete _user.twitter.accessTokenSecret;
|
||||||
|
|
Loading…
Reference in a new issue