diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-10-21 17:58:02 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-21 17:58:02 +0900 |
| commit | b8ed8336e0a79330b59233fb51c641f87e65263f (patch) | |
| tree | 14bcad3e3af1f04b73ce90b6693988693cad5d2c /src | |
| parent | Implement following stats (diff) | |
| download | misskey-b8ed8336e0a79330b59233fb51c641f87e65263f.tar.gz misskey-b8ed8336e0a79330b59233fb51c641f87e65263f.tar.bz2 misskey-b8ed8336e0a79330b59233fb51c641f87e65263f.zip | |
Improve readability
Diffstat (limited to 'src')
| -rw-r--r-- | src/services/stats.ts | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/services/stats.ts b/src/services/stats.ts index a0b3a28745..23ffae9885 100644 --- a/src/services/stats.ts +++ b/src/services/stats.ts @@ -748,7 +748,12 @@ class FollowingStats extends Stats<FollowingLog> { @autobind protected async getTemplate(init: boolean, latestLog?: FollowingLog, group?: any): Promise<FollowingLog> { - const [localFollowings, localFollowers, remoteFollowings, remoteFollowers] = init ? await Promise.all([ + const [ + localFollowingsCount, + localFollowersCount, + remoteFollowingsCount, + remoteFollowersCount + ] = init ? await Promise.all([ Following.count({ followerId: group, '_followee.host': null }), Following.count({ followeeId: group, '_user.host': null }), Following.count({ followerId: group, '_followee.host': { $ne: null } }), @@ -763,24 +768,24 @@ class FollowingStats extends Stats<FollowingLog> { return { local: { followings: { - total: localFollowings, + total: localFollowingsCount, inc: 0, dec: 0 }, followers: { - total: localFollowers, + total: localFollowersCount, inc: 0, dec: 0 } }, remote: { followings: { - total: remoteFollowings, + total: remoteFollowingsCount, inc: 0, dec: 0 }, followers: { - total: remoteFollowers, + total: remoteFollowersCount, inc: 0, dec: 0 } |