Skip to content

Let's use AI to Earn!

570 B
Raw Blame
import type { SocialAccount } from '@/api/accounts/account.types'
import { PlatType } from '@/app/config/platConfig'

const temporaryUnavailableFansPlatforms = new Set<PlatType>([
  PlatType.Douyin,
  PlatType.WxGzh,
])

export function calcSocialAccountsTotalFans(accounts: Array<Pick<SocialAccount, 'fansCount'>>) {
  return accounts.reduce((sum, account) => sum + (account.fansCount || 0), 0)
}

export function shouldShowFansSyncNotice(type: PlatType, fansCount: number | null | undefined) {
  return temporaryUnavailableFansPlatforms.has(type) && fansCount === 0
}