fix(accounts): учитывать baseCurrency хостера при отображении и синке баланса
Docker / build (push) Has been cancelled
Docker / build (push) Has been cancelled
API не всегда возвращает валюту (VDSina UserAPI); раньше подставлялся RUB вместо USD из настроек провайдера. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -1 +1 @@
|
||||
export { accountBalanceApi, accountBalanceCurrency } from '@cfdm/shared/utils/account-balance'
|
||||
export { accountBalanceApi, accountBalanceCurrency, effectiveAccountBalanceCurrency } from '@cfdm/shared/utils/account-balance'
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
providerAccountFormDefaults,
|
||||
} from '@/components/domain/account-edit-sheet'
|
||||
import type { ProviderAccountFormValues } from '@/lib/schemas'
|
||||
import { accountBalanceApi, accountBalanceCurrency } from '@/lib/account'
|
||||
import { accountBalanceApi, effectiveAccountBalanceCurrency } from '@/lib/account'
|
||||
import type { ProviderAccount } from '@/types/entities'
|
||||
import { providerByIdMap, accountBillmanagerUiReady, billmanagerSyncableAccounts } from '@/lib/billmanager'
|
||||
import { billingModeLabel, formatCurrency, formatRelativeTime } from '@/lib/format'
|
||||
@@ -337,7 +337,7 @@ function AccountsPage() {
|
||||
cell: (a) => {
|
||||
const provider = providerById.get(a.providerId)
|
||||
if (!accountBillmanagerUiReady(a, provider)) return <span className="text-muted-foreground">—</span>
|
||||
const cur = accountBalanceCurrency(a)
|
||||
const cur = effectiveAccountBalanceCurrency(a, provider)
|
||||
const ext = a as ProviderAccount & { enoughmoneyto?: string }
|
||||
return dataGridCellStack(
|
||||
formatCurrency(accountBalanceApi(a) ?? 0, cur),
|
||||
|
||||
Reference in New Issue
Block a user