Skip to content

Commit

Permalink
fixed build bugs so i can deploy (#87)
Browse files Browse the repository at this point in the history
* fixed build bugs so i can deploy

* v1.1.1
  • Loading branch information
zfogg committed Nov 30, 2022
1 parent 98ed172 commit c923e02
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/hooks/base/useBlockDiff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ import { useWeb3React } from '@web3-react/core'
import { providerKey } from '@/utils/index'
import { useQuery } from '@tanstack/react-query'
import useBlock from './useBlock'
import { BigNumber } from 'ethers'

interface BlockDiffOptions {
firstDepositBlock: number
lastWithdrawBlock: number
firstDepositBlock: BigNumber
lastWithdrawBlock: BigNumber
}

const useBlockDiff = (options: BlockDiffOptions) => {
const useBlockDiff = (options?: BlockDiffOptions) => {
const { library, chainId, account } = useWeb3React()
const block = useBlock()

const enabled = !!library && !!block
const enabled = !!library && !!block && !!options
const { data: blockDiff } = useQuery(
['@/hooks/base/useBlockDiff', providerKey(library, account, chainId), options, { block }],
async () => {
const { firstDepositBlock, lastWithdrawBlock } = options
const firstOrLast = firstDepositBlock > lastWithdrawBlock ? firstDepositBlock : lastWithdrawBlock
const firstOrLast = firstDepositBlock.gt(lastWithdrawBlock) ? firstDepositBlock.toNumber() : lastWithdrawBlock.toNumber()
const _blockDiff = block - firstOrLast
return _blockDiff
},
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/baskets/useComposition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { decimate, exponentiate } from '@/utils/numberFormat'
import { useWeb3React } from '@web3-react/core'
import { BigNumber } from 'ethers'
import { ActiveSupportedBasket } from '../../bao/lib/types'
import { fetchSushiApy } from './strategies/useSushiBarApy'
import fetchSushiApy from './strategies/useSushiBarApy'
import useGeckoPrices from './useGeckoPrices'
import { providerKey } from '@/utils/index'
import { useQuery } from '@tanstack/react-query'
Expand Down
2 changes: 1 addition & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import TransactionProvider from '@/contexts/Transactions'
import TxPopup from '@/components/TxPopup'
import '@/components/TxPopup/styles.css'

console.log('v1.1.0')
console.log('v1.1.1')

function getLibrary(provider: any): Web3Provider {
const library = new Web3Provider(provider)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/farms/components/Modals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const FeeModal: React.FC<FeeModalProps> = ({ pid, show, onHide }) => {
{
label: 'Last withdraw block:',
value: `
${userInfo ? userInfo.lastWithdrawBlock === '0' ? 'Never Withdrawn' : userInfo.lastWithdrawBlock : <Loader />}
${userInfo ? userInfo.lastWithdrawBlock.eq(0) ? 'Never Withdrawn' : userInfo.lastWithdrawBlock.toNumber() : <Loader />}
`,
},
]}
Expand Down

0 comments on commit c923e02

Please sign in to comment.