Skip to content

Commit 77216e9

Browse files
committed
feat: improve followed count display
1 parent 1b6198c commit 77216e9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/modules/user/profile.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ export const queryProfile = async ({
7373
profile: ApiResponses.Users.Profile
7474
): profile is ApiResponses.Users.MyProfile => profile.user.id === user.userId
7575

76-
if (isTable) {
77-
showTable()
78-
} else {
79-
showText()
80-
}
76+
const formatFollowedCount = (count: number) =>
77+
colors.bold(count === 100000 ? colors.red('99999+') : `${count}`)
78+
79+
if (isTable) showTable()
80+
else showText()
8181

8282
function showText() {
8383
const texts: string[][] = [
@@ -95,7 +95,7 @@ export const queryProfile = async ({
9595
],
9696
[
9797
`${colors.bold(`${result.user.statsCount.followingCount}`)} 关注`,
98-
`${colors.bold(`${result.user.statsCount.followedCount}`)} 被关注`,
98+
`${formatFollowedCount(result.user.statsCount.followedCount)} 被关注`,
9999
`${colors.bold(`${result.user.statsCount.respectedCount}`)} 夸夸`,
100100
],
101101
[],

0 commit comments

Comments
 (0)