Skip to content

Commit 893bff6

Browse files
authored
Merge pull request #330 from reflexer-labs/develop
adding ipfs alias to the release workflow, fix min RAI amount per saf…
2 parents 9a0c079 + f2a3469 commit 893bff6

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,14 @@ jobs:
103103
104104
The latest release is always accessible via our alias to the Cloudflare at [app.reflexer.finance](https://app.reflexer.finance).
105105
106-
You can also access the Reflexer app directly from an IPFS gateway.
106+
You can also access the Reflexer app directly from an IPFS the Cloudflare IPFS gateway at [ipfs.reflexer.finance](https://ipfs.reflexer.finance).
107+
107108
**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.
108-
**You should always use an IPFS gateway that enforces origin separation**, or our alias to the latest release
109+
**You should always use an IPFS gateway that enforces origin separation**, or our ipfs alias to the latest release
109110
110111
IPFS gateways:
111112
- https://${{ steps.convert_cidv0.outputs.cidv1 }}.ipfs.dweb.link/
113+
- https://${{ steps.convert-cidv0.outputs.cidv1 }}.ipfs.cf-ipfs.com/
112114
- [ipfs://${{ steps.upload.outputs.hash }}/](ipfs://${{ steps.upload.outputs.hash }}/)
113115
114116
${{ needs.bump_version.outputs.changelog }}

src/components/StepsContent.tsx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
import React, { useEffect, useState } from 'react'
1+
import React, { useEffect, useMemo, useState } from 'react'
22
import { AlertCircle, Circle, X } from 'react-feather'
33
import { useTranslation } from 'react-i18next'
44
import styled from 'styled-components'
5-
import _ from '../utils/lodash'
6-
import { useStoreState } from '../store'
75
import Button from './Button'
86
import { formatNumber } from '../utils/helper'
97
import { useActiveWeb3React } from '../hooks'
108
import { utils } from 'geb.js'
119
import { parseRad } from '../utils/gebManager'
12-
import { geb } from '../utils/constants'
10+
import { geb as gebNode } from '../utils/constants'
1311
import Loader from './Loader'
12+
import useGeb from 'src/hooks/useGeb'
1413

1514
interface Props {
1615
title: string
@@ -33,28 +32,26 @@ const StepsContent = ({
3332
isLoading,
3433
id,
3534
}: Props) => {
35+
const geb = useGeb()
3636
const { t } = useTranslation()
3737
const { account } = useActiveWeb3React()
3838
const [debtFloor, setDebtFloor] = useState('')
39-
const { safeModel: safeState } = useStoreState((state) => state)
40-
4139
const [isOpen, setIsOpen] = useState(true)
4240

43-
const debtFloorVal = _.get(safeState, 'liquidationData.debtFloor', '0')
44-
45-
useEffect(() => {
46-
async function getDebtFloor() {
47-
const res = await geb.contracts.safeEngine.collateralTypes(
48-
utils.ETH_A
49-
)
50-
setDebtFloor(parseRad(res.debtFloor))
51-
}
41+
const gebCall = useMemo(() => {
5242
if (account) {
53-
setDebtFloor(debtFloorVal)
54-
} else {
55-
getDebtFloor()
43+
return geb
5644
}
57-
}, [account, debtFloorVal])
45+
return gebNode
46+
}, [account, geb])
47+
48+
useEffect(() => {
49+
if (!gebCall) return
50+
gebCall.contracts.safeEngine
51+
.collateralTypes(utils.ETH_A)
52+
.then((res) => setDebtFloor(parseRad(res.debtFloor)))
53+
.catch((e) => console.log(e))
54+
}, [gebCall])
5855

5956
const handleOpenState = () => setIsOpen(!isOpen)
6057

0 commit comments

Comments
 (0)