Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Update navigation method after removing a Safe
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Sanchez committed Jul 30, 2021
1 parent 035ef54 commit 47dee02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/routes/safe/components/Settings/RemoveSafeModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useDispatch, useSelector } from 'react-redux'

import { useStyles } from './style'

import { history } from 'src/store'
import Modal, { Modal as GenericModal } from 'src/components/Modal'
import Block from 'src/components/layout/Block'
import Hairline from 'src/components/layout/Hairline'
Expand Down Expand Up @@ -39,10 +40,9 @@ const RemoveSafeModal = ({ isOpen, onClose }: RemoveSafeModalProps): React.React
}

onClose()
// using native redirect in order to avoid problems in several components
// trying to access references of the removed safe.
const relativePath = window.location.href.split('/#/')[0]
window.location.href = `${relativePath}/#/${WELCOME_ADDRESS}`
history.push({
pathname: `${WELCOME_ADDRESS}`,
})
}

return (
Expand Down

0 comments on commit 47dee02

Please sign in to comment.