返回 AiToEarn
account.ts
根目录 / project / aitoearn-web / src / utils / social / account.ts
1 import type { SocialAccount } from '@/api/accounts/account.types'
2 import { PlatType } from '@/app/config/platConfig'
3
4 const temporaryUnavailableFansPlatforms = new Set<PlatType>([
5 PlatType.Douyin,
6 PlatType.WxGzh,
7 ])
8
9 export function calcSocialAccountsTotalFans(accounts: Array<Pick<SocialAccount, 'fansCount'>>) {
10 return accounts.reduce((sum, account) => sum + (account.fansCount || 0), 0)
11 }
12
13 export function shouldShowFansSyncNotice(type: PlatType, fansCount: number | null | undefined) {
14 return temporaryUnavailableFansPlatforms.has(type) && fansCount === 0
15 }
16
16 lines TYPESCRIPT