Skip to content

Commit

Permalink
Merge pull request #303 from reflexer-labs/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
mstfash authored Mar 4, 2022
2 parents e0171b7 + aa32459 commit 4b89444
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/containers/Auctions/AuctionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,14 @@ const AuctionsList = ({ type }: Props) => {
{account &&
auctions &&
auctions.length &&
(Number(internalBalance) > 0 ||
Number(protInternalBalance) > 0) ? (
(Number(internalBalance) >= 0.0001 ||
Number(protInternalBalance) >= 0.0001) ? (
<Button
text={t('claim_tokens')}
onClick={() => handleClick('claim_tokens')}
/>
) : null}
</Box>

<span>{`Status`}</span>
</InfoBox>
{auctions && auctions.length > 0 ? (
<>
Expand Down
15 changes: 10 additions & 5 deletions src/containers/OnBoarding/ModifySafe.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ethers } from 'ethers'
import { BigNumber, ethers } from 'ethers'
import React, { useCallback, useMemo, useState } from 'react'
import styled from 'styled-components'
import Button from '../../components/Button'
Expand Down Expand Up @@ -90,20 +90,25 @@ const ModifySafe = ({
onLeftInput(availableEth as string)
}
}

const onMaxRightInput = () => {
if (isDeposit) {
onRightInput(availableRai.toString())
} else {
const availableRaiBN = ethers.utils.parseEther(availableRai)

const raiBalanceBN = ethers.utils.parseEther(
balances.rai.toString()
)
const raiBalanceBN = balances.rai
? ethers.utils.parseEther(balances.rai.toString())
: BigNumber.from('0')

const isMore = raiBalanceBN.gt(availableRaiBN)

onRightInput(
isMore ? availableRai.toString() : balances.rai.toString()
isMore
? availableRai.toString()
: balances.rai
? balances.rai.toString()
: '0'
)
}
}
Expand Down

0 comments on commit 4b89444

Please sign in to comment.