Skip to content

Commit

Permalink
fix: autoswitch off by 1 (#467)
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Feb 7, 2024
1 parent 9c3e5ac commit 32b1626
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ const Create = () => {
minerFee,
} = useCreateContext();

// if btc and amount > 9, switch to sat
// if btc and amount > 10, switch to sat
// user failed to notice the non satoshi denomination
const changeDenomination = (amount: string) => {
if (amount === "") return;
if (denomination() === denominations.btc && Number(amount) > 9) {
if (denomination() === denominations.btc && Number(amount) >= 10) {
setDenomination(denominations.sat);
} else if (denomination() === denominations.sat && Number(amount) < 1) {
setDenomination(denominations.btc);
Expand Down

0 comments on commit 32b1626

Please sign in to comment.