Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/app/context/AccountContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export function AccountProvider({ children }: { children: React.ReactNode }) {
currency?: AccountInfo["currency"]
) => {
const balance = getFormattedInCurrency(amount, currency);
setAccountBalance(balance);
Number.isFinite(amount)
? setAccountBalance(balance)
: setAccountBalance("");
};

const fetchAccountInfo = async (options?: { accountId?: string }) => {
Expand Down Expand Up @@ -170,7 +172,11 @@ export function AccountProvider({ children }: { children: React.ReactNode }) {

// Listen to showFiat
useEffect(() => {
if (showFiat && typeof account?.balance === "number") {
if (
showFiat &&
typeof account?.balance === "number" &&
Number.isFinite(account.balance)
) {
updateFiatValue(account.balance);
} else {
setFiatBalance("");
Expand Down
2 changes: 1 addition & 1 deletion src/app/screens/Options/TestConnection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default function TestConnection() {
accountName={accountInfo.name}
alias={accountInfo.alias}
satoshis={
typeof accountInfo.balance === "number"
Number.isFinite(accountInfo.balance)
? getFormattedInCurrency(
accountInfo.balance,
accountInfo.currency
Expand Down