mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 20:43:08 +02:00
Improve readability
This commit is contained in:
parent
13f82856f9
commit
b8ed8336e0
1 changed files with 10 additions and 5 deletions
|
@ -748,7 +748,12 @@ class FollowingStats extends Stats<FollowingLog> {
|
||||||
|
|
||||||
@autobind
|
@autobind
|
||||||
protected async getTemplate(init: boolean, latestLog?: FollowingLog, group?: any): Promise<FollowingLog> {
|
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({ followerId: group, '_followee.host': null }),
|
||||||
Following.count({ followeeId: group, '_user.host': null }),
|
Following.count({ followeeId: group, '_user.host': null }),
|
||||||
Following.count({ followerId: group, '_followee.host': { $ne: null } }),
|
Following.count({ followerId: group, '_followee.host': { $ne: null } }),
|
||||||
|
@ -763,24 +768,24 @@ class FollowingStats extends Stats<FollowingLog> {
|
||||||
return {
|
return {
|
||||||
local: {
|
local: {
|
||||||
followings: {
|
followings: {
|
||||||
total: localFollowings,
|
total: localFollowingsCount,
|
||||||
inc: 0,
|
inc: 0,
|
||||||
dec: 0
|
dec: 0
|
||||||
},
|
},
|
||||||
followers: {
|
followers: {
|
||||||
total: localFollowers,
|
total: localFollowersCount,
|
||||||
inc: 0,
|
inc: 0,
|
||||||
dec: 0
|
dec: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
remote: {
|
remote: {
|
||||||
followings: {
|
followings: {
|
||||||
total: remoteFollowings,
|
total: remoteFollowingsCount,
|
||||||
inc: 0,
|
inc: 0,
|
||||||
dec: 0
|
dec: 0
|
||||||
},
|
},
|
||||||
followers: {
|
followers: {
|
||||||
total: remoteFollowers,
|
total: remoteFollowersCount,
|
||||||
inc: 0,
|
inc: 0,
|
||||||
dec: 0
|
dec: 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue