@@ -142,20 +142,23 @@ export function useTabbedPageNav() {
142142 // This navigate() call will happen inside tabbed page context
143143 ionRouter . navigate ( event . detail . url , event . detail . routerDirection , event . detail . routerAction ) ;
144144
145- perComponentPathCallbacks . pop ( ) ;
146- if ( perComponentPathCallbacks . length ) {
147- window . trackTabbedPageNavigationEvent ( {
148- type : 'otherNavCallbackDelegation' , params : { perComponentPathCallbacksSize : perComponentPathCallbacks . length }
149- } )
150- const nextCallback = perComponentPathCallbacks [ perComponentPathCallbacks . length - 1 ] ;
151- await new Promise ( ( resolve ) => {
152- setTimeout ( async ( ) => {
153- await nextCallback . navCallback ( event ) ;
154- resolve ( null ) ;
155- } , 0 ) ;
156- } ) ;
157- } else {
158- PER_COMPONENT_PATH_CALLBACKS . delete ( currentComponentInstancePath ) ;
145+ if ( event . detail . routerAction === 'pop' ) {
146+ perComponentPathCallbacks . pop ( ) ;
147+ if ( perComponentPathCallbacks . length ) {
148+ window . trackTabbedPageNavigationEvent ( {
149+ type : 'otherNavCallbackDelegation' , params : { perComponentPathCallbacksSize : perComponentPathCallbacks . length }
150+ } )
151+
152+ const nextCallback = perComponentPathCallbacks [ perComponentPathCallbacks . length - 1 ] ;
153+ await new Promise ( ( resolve ) => {
154+ setTimeout ( async ( ) => {
155+ await nextCallback . navCallback ( event ) ;
156+ resolve ( null ) ;
157+ } , 0 ) ;
158+ } ) ;
159+ } else {
160+ PER_COMPONENT_PATH_CALLBACKS . delete ( currentComponentInstancePath ) ;
161+ }
159162 }
160163 } else {
161164 throw new Error ( `Unexpected event type ${ event . type } in tabbed-page-navigation callback registration !` )
0 commit comments