Skip to content

Commit

Permalink
Merge pull request #127 from reflexer-labs/deployment
Browse files Browse the repository at this point in the history
fix safe check loop
  • Loading branch information
mstfash authored Mar 9, 2021
2 parents df6220a + e2c56d9 commit bd6365a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
13 changes: 8 additions & 5 deletions src/components/NavLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,21 @@ const NavLinks = () => {
<Shield /> {t('insurance')}
</LinkItem>
<MenuBox className="menu-box">
{/* <ExtLink href="https://nexusmutual.io/" target="_blank">
Nexus Mutual{' '}
<ExtLink
href="https://app.coverprotocol.com/app/marketplace/protocols/RAI"
target="_blank"
>
Cover Protocol
<img
src={require('../assets/dark-arrow.svg')}
alt="arrow"
/>
</ExtLink> */}
</ExtLink>
<ExtLink
href="https://app.coverprotocol.com/app/marketplace/protocols/RAI"
href="https://app.nexusmutual.io/cover/buy/get-quote?address=0xCC88a9d330da1133Df3A7bD823B95e52511A6962"
target="_blank"
>
Cover Protocol
Nexus Mutual{' '}
<img
src={require('../assets/dark-arrow.svg')}
alt="arrow"
Expand Down
8 changes: 1 addition & 7 deletions src/containers/OnBoarding/SafeDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import SafeStats from '../../components/SafeStats'
import { useActiveWeb3React } from '../../hooks'
import useGeb from '../../hooks/useGeb'
import { useStoreActions, useStoreState } from '../../store'
import { timeout } from '../../utils/helper'
import { isNumeric } from '../../utils/validations'

const SafeDetails = ({ ...props }) => {
Expand Down Expand Up @@ -46,12 +45,7 @@ const SafeDetails = ({ ...props }) => {
geb,
isRPCAdapterOn,
})
const safeData = await safeActions.fetchManagedSafe(safeId)
if (safeData && !safeData.safes.length) {
await timeout(200)
props.history.push('/')
return
}
await safeActions.fetchManagedSafe(safeId)
popupsActions.setIsWaitingModalOpen(false)
}

Expand Down
18 changes: 17 additions & 1 deletion src/containers/Shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@ import AuctionsModal from '../components/Modals/AuctionsModal'
import AlertLabel from '../components/AlertLabel'
import useGeb from '../hooks/useGeb'
import SafeManagerModal from '../components/Modals/SafeManagerModal'
import { isAddress } from '@ethersproject/address'

interface Props {
children: ReactNode
}

const Shared = ({ children }: Props) => {
const Shared = ({ children, ...rest }: Props) => {
const { t } = useTranslation()
const { chainId, account, library, connector } = useActiveWeb3React()
const geb = useGeb()
const history = useHistory()

const previousAccount = usePrevious(account)

const {
settingsModel: settingsState,
connectWalletModel: connectWalletState,
Expand Down Expand Up @@ -95,6 +98,19 @@ const Shared = ({ children }: Props) => {
await timeout(200)
if (!connectWalletState.ctHash) {
connectWalletActions.setStep(2)
const { pathname } = history.location
let address = ''
if (pathname && pathname !== '/') {
const route = pathname.split('/')[1]
if (isAddress(route)) {
address = route.toLowerCase()
}
}
await safeActions.fetchUserSafes({
address: address ? address : (account as string),
geb,
isRPCAdapterOn: settingsState.isRPCAdapterOn,
})
}
} catch (error) {
safeActions.setIsSafeCreated(false)
Expand Down

0 comments on commit bd6365a

Please sign in to comment.