File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -47,10 +47,13 @@ const Pin: React.FC<Props> = props => {
4747 const { biometricsAvailable} = useAppSelector ( state => state . authentication ! ) ;
4848
4949 useEffect ( ( ) => {
50- const unsubscribe = navigation . addListener ( 'beforeRemove' , ( ) => {
51- dispatch ( resetPincode ( ) ) ;
52- if ( beingRecovered ) {
53- dispatch ( resetSeedAction ( ) ) ;
50+ const unsubscribe = navigation . addListener ( 'beforeRemove' , ( e ) => {
51+ // Only reset if going back, not when navigating forward
52+ if ( e . data . action . type === 'GO_BACK' || e . data . action . type === 'POP' ) {
53+ dispatch ( resetPincode ( ) ) ;
54+ if ( beingRecovered ) {
55+ dispatch ( resetSeedAction ( ) ) ;
56+ }
5457 }
5558 } ) ;
5659
Original file line number Diff line number Diff line change @@ -66,9 +66,12 @@ const Recover: React.FC<Props> = props => {
6666 const styles = getStyles ( SCREEN_WIDTH , SCREEN_HEIGHT ) ;
6767
6868 useEffect ( ( ) => {
69- const unsubscribe = navigation . addListener ( 'beforeRemove' , ( ) => {
70- dispatch ( resetSeedAction ( ) ) ;
71- dispatch ( setRecoveryMode ( false ) ) ;
69+ const unsubscribe = navigation . addListener ( 'beforeRemove' , ( e ) => {
70+ // Only reset if going back, not when navigating forward
71+ if ( e . data . action . type === 'GO_BACK' || e . data . action . type === 'POP' ) {
72+ dispatch ( resetSeedAction ( ) ) ;
73+ dispatch ( setRecoveryMode ( false ) ) ;
74+ }
7275 } ) ;
7376
7477 return unsubscribe ;
You can’t perform that action at this time.
0 commit comments