feat: 接入公开币种目录并统一多币种金额与语言初始化处理

This commit is contained in:
2026-05-21 15:14:00 +08:00
parent 626914feb6
commit 6b18e25766
27 changed files with 277 additions and 94 deletions

View File

@@ -15,6 +15,7 @@ import {
} from "@/features/wallet/wallet-transfer-dialogs";
import { WalletLogsBlock } from "@/features/wallet/wallet-logs-block";
import { formatMinorAsCurrency } from "@/lib/money";
import { resolvePlayerCurrency } from "@/lib/player-currency";
import { formatWalletClientError } from "@/lib/wallet-api-error";
import { usePlayerSessionStore } from "@/stores/player-session-store";
import type { WalletBalanceData } from "@/types/api/wallet-balance";
@@ -34,13 +35,10 @@ export function WalletScreen() {
const [error, setError] = useState<string | null>(null);
const loadMoreRef = useRef<HTMLDivElement | null>(null);
const currency = useMemo(() => {
return (
balance?.currency_code ??
profile?.default_currency ??
"NPR"
).toUpperCase();
}, [balance?.currency_code, profile?.default_currency]);
const currency = useMemo(
() => resolvePlayerCurrency(profile, balance),
[balance, profile],
);
const fetchPassRef = useRef(true);