Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing bigint constants #707

Merged
merged 1 commit into from
Dec 20, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/components/ModalAddManyTokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ModalAddManyTokens extends React.Component {
available: 0n,
locked: 0n,
});
const tokenHasZeroBalance = (available + locked) === 0;
const tokenHasZeroBalance = (available + locked) === 0n;

/*
* We only make this validation if the "Hide Zero-Balance Tokens" setting is active,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ModalAddToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ModalAddToken extends React.Component {
const tokenUid = tokenData.uid;
const tokenBalance = tokensBalance[tokenUid]?.data;
const tokenHasZeroBalance = !tokenBalance
|| (tokenBalance.available + tokenBalance.locked) === 0;
|| (tokenBalance.available + tokenBalance.locked) === 0n;

/*
* We only make this validation if the "Hide Zero-Balance Tokens" setting is active,
Expand Down
2 changes: 1 addition & 1 deletion src/components/atomic-swap/ModalAtomicReceive.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function ModalAtomicReceive ({ sendClickHandler, receivableTokens, manage
return false;
}

if (amount === 0 || !amount) {
if (amount === 0n || !amount) {
setErrMessage(t`Must receive a positive amount of tokens`);
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/atomic-swap/ModalAtomicSend.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export function ModalAtomicSend ({ sendClickHandler, sendableTokens, tokenBalanc
}

// Validating mandatory amount
if (amount === 0 || !amount) {
if (amount === 0n || !amount) {
setErrMessage(t`Must send a positive amount of tokens`);
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const wallet = {
const totalBalance = balance.available + balance.locked;

// This token has zero balance: skip it.
if (hideZeroBalance && totalBalance === 0) {
if (hideZeroBalance && totalBalance === 0n) {
continue;
}
}
Expand Down Expand Up @@ -302,7 +302,7 @@ const wallet = {
const totalBalance = balance.available + balance.locked;

// This token has zero balance: skip it.
if (totalBalance === 0) {
if (totalBalance === 0n) {
continue;
}
}
Expand Down
Loading