File tree Expand file tree Collapse file tree
packages/neuron-ui/src/components/Settings Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { StateWithDispatch } from 'states/stateProvider/reducer'
99import GeneralSetting from 'components/GeneralSetting'
1010import Wallets from 'components/WalletSetting'
1111import NetworkSetting from 'components/NetworkSetting'
12+ import { WalletWizardPath } from 'components/WalletWizard'
1213
1314import { Routes } from 'utils/const'
1415
@@ -46,15 +47,16 @@ const Settings = ({
4647 ...neuronWalletState
4748} : React . PropsWithoutRef < StateWithDispatch & RouteComponentProps > ) => {
4849 const [ t ] = useTranslation ( )
49- const goBack = useCallback ( ( ) => {
50- history . goBack ( )
51- } , [ history ] )
50+ const { id } = neuronWalletState . wallet
51+ const onLeave = useCallback ( ( ) => {
52+ return id ? history . push ( Routes . Overview ) : history . push ( `${ Routes . WalletWizard } ${ WalletWizardPath . Welcome } ` )
53+ } , [ id , history ] )
5254
5355 return (
5456 < Stack tokens = { { childrenGap : 15 } } >
5557 < Stack horizontal >
5658 < Stack . Item align = "center" >
57- < IconButton onClick = { goBack } styles = { { root : { marginRight : 20 } } } >
59+ < IconButton onClick = { onLeave } styles = { { root : { marginRight : 20 } } } >
5860 < FormPreviousLink />
5961 </ IconButton >
6062 </ Stack . Item >
You can’t perform that action at this time.
0 commit comments