Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
Update erdjs package
Browse files Browse the repository at this point in the history
  • Loading branch information
danielailie committed Apr 29, 2021
1 parent 66eaa2f commit 3c6c539
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 25 deletions.
49 changes: 28 additions & 21 deletions react-delegationdashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion react-delegationdashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@elrondnetwork/erdjs": "^4.0.3",
"@elrondnetwork/erdjs": "^4.1.0",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/react-fontawesome": "^0.1.12",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const DelegateModal = ({ show, balance, handleClose, handleContinue }: DelegateM
};

const getAvailableToDelegate = () => {
if (contractOverview?.withDelegationCap === 'true') {
if (contractOverview && contractOverview?.withDelegationCap === 'true') {
const bnAvailable = new BigNumber(entireBalanceMinusDust);
const totalActive = denominate({
input: totalActiveStake,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ const UndelegatedListView = () => {
undelegatedList: UndelegatedValueType[]
) => {
let timeLeft = 0;
if (decodeString(value.outputUntyped()[index + 1]) !== '') {
const untypedResponse = value.outputUntyped();
if (decodeString(untypedResponse[index + 1]) !== '') {
timeLeft = getTimeLeft(value, index, timeLeft);
}
const element = new UndelegatedValueType(
denomintateValue(decodeBigNumber(value.outputUntyped()[index]).toFixed()),
denomintateValue(decodeBigNumber(untypedResponse[index]).toFixed()),
timeLeft
);
undelegatedList.push(element);
Expand Down

0 comments on commit 3c6c539

Please sign in to comment.