Skip to content

Commit

Permalink
Merge branch 'update-stake-preview' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
lq0-github committed Oct 24, 2024
2 parents 34e1b77 + e079ae2 commit 49c1cc4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions screens/Staking/modalStaking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,15 @@ const ModalStaking = ({ isOpen, onClose }) => {
};

const handleRangeSliderChange = (percent) => {
if (percent >= 100) {
setAmount(String(Number(total) * 1.01));
if (Number(total) === 0) {
setAmount("0");
} else if (percent >= 100) {
setAmount(totalToken);
} else if (Number(percent) >= 99.7) {
setAmount(totalToken);
} else {
setAmount(((Number(total) * percent) / 100).toFixed(8));
const calculatedAmount = (Number(total) * percent) / 100;
setAmount(Number(calculatedAmount) === 0 ? "0" : calculatedAmount);
}
};

Expand Down

0 comments on commit 49c1cc4

Please sign in to comment.