diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b2ab748..44795918 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -103,12 +103,14 @@ jobs: The latest release is always accessible via our alias to the Cloudflare at [app.reflexer.finance](https://app.reflexer.finance). - You can also access the Reflexer app directly from an IPFS gateway. + You can also access the Reflexer app directly from an IPFS the Cloudflare IPFS gateway at [ipfs.reflexer.finance](https://ipfs.reflexer.finance). + **BEWARE**: The Reflexer app uses [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to remember your settings, such as transactions hashes. - **You should always use an IPFS gateway that enforces origin separation**, or our alias to the latest release + **You should always use an IPFS gateway that enforces origin separation**, or our ipfs alias to the latest release IPFS gateways: - https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.dweb.link/ + - https://${{ steps.convert-cidv0.outputs.cidv1 }}.ipfs.cf-ipfs.com/ - [ipfs://${{ steps.upload.outputs.hash }}/](ipfs://${{ steps.upload.outputs.hash }}/) ${{ needs.bump_version.outputs.changelog }} diff --git a/src/components/StepsContent.tsx b/src/components/StepsContent.tsx index 6f0db663..12589f0e 100644 --- a/src/components/StepsContent.tsx +++ b/src/components/StepsContent.tsx @@ -1,16 +1,15 @@ -import React, { useEffect, useState } from 'react' +import React, { useEffect, useMemo, useState } from 'react' import { AlertCircle, Circle, X } from 'react-feather' import { useTranslation } from 'react-i18next' import styled from 'styled-components' -import _ from '../utils/lodash' -import { useStoreState } from '../store' import Button from './Button' import { formatNumber } from '../utils/helper' import { useActiveWeb3React } from '../hooks' import { utils } from 'geb.js' import { parseRad } from '../utils/gebManager' -import { geb } from '../utils/constants' +import { geb as gebNode } from '../utils/constants' import Loader from './Loader' +import useGeb from 'src/hooks/useGeb' interface Props { title: string @@ -33,28 +32,26 @@ const StepsContent = ({ isLoading, id, }: Props) => { + const geb = useGeb() const { t } = useTranslation() const { account } = useActiveWeb3React() const [debtFloor, setDebtFloor] = useState('') - const { safeModel: safeState } = useStoreState((state) => state) - const [isOpen, setIsOpen] = useState(true) - const debtFloorVal = _.get(safeState, 'liquidationData.debtFloor', '0') - - useEffect(() => { - async function getDebtFloor() { - const res = await geb.contracts.safeEngine.collateralTypes( - utils.ETH_A - ) - setDebtFloor(parseRad(res.debtFloor)) - } + const gebCall = useMemo(() => { if (account) { - setDebtFloor(debtFloorVal) - } else { - getDebtFloor() + return geb } - }, [account, debtFloorVal]) + return gebNode + }, [account, geb]) + + useEffect(() => { + if (!gebCall) return + gebCall.contracts.safeEngine + .collateralTypes(utils.ETH_A) + .then((res) => setDebtFloor(parseRad(res.debtFloor))) + .catch((e) => console.log(e)) + }, [gebCall]) const handleOpenState = () => setIsOpen(!isOpen)