@@ -23,7 +23,7 @@ import { CoreMainMenuDelegate, CoreMainMenuHandlerToDisplay } from '../../servic
2323import { Router } from '@singletons' ;
2424import { CoreUtils } from '@services/utils/utils' ;
2525import { CoreAriaRoleTab , CoreAriaRoleTabFindable } from '@classes/aria-role-tab' ;
26- import { CoreNavigationOptions , CoreNavigator } from '@services/navigator' ;
26+ import { CoreNavigator } from '@services/navigator' ;
2727import { filter } from 'rxjs/operators' ;
2828import { NavigationEnd } from '@angular/router' ;
2929import { trigger , state , style , transition , animate } from '@angular/animations' ;
@@ -32,6 +32,7 @@ import { CoreDom } from '@singletons/dom';
3232import { CoreLogger } from '@singletons/logger' ;
3333import { CorePlatform } from '@services/platform' ;
3434import { CoreWait } from '@singletons/wait' ;
35+ import { CoreMainMenuDeepLinkManager } from '@features/mainmenu/classes/deep-link-manager' ;
3536
3637const ANIMATION_DURATION = 500 ;
3738
@@ -83,9 +84,6 @@ export class CoreMainMenuPage implements OnInit, OnDestroy {
8384 protected backButtonFunction : ( event : BackButtonEvent ) => void ;
8485 protected selectHistory : string [ ] = [ ] ;
8586 protected firstSelectedTab ?: string ;
86- protected urlToOpen ?: string ;
87- protected redirectPath ?: string ;
88- protected redirectOptions ?: CoreNavigationOptions ;
8987 protected logger : CoreLogger ;
9088
9189 @ViewChild ( 'mainTabs' ) mainTabs ?: IonTabs ;
@@ -111,9 +109,16 @@ export class CoreMainMenuPage implements OnInit, OnDestroy {
111109 */
112110 async ngOnInit ( ) : Promise < void > {
113111 this . showTabs = true ;
114- this . urlToOpen = CoreNavigator . getRouteParam ( 'urlToOpen' ) ;
115- this . redirectPath = CoreNavigator . getRouteParam ( 'redirectPath' ) ;
116- this . redirectOptions = CoreNavigator . getRouteParam ( 'redirectOptions' ) ;
112+
113+ const deepLinkManager = new CoreMainMenuDeepLinkManager ( ) ;
114+
115+ // Treat the deep link (if any) when the login navigation finishes.
116+ CoreSites . runAfterLoginNavigation ( {
117+ priority : 800 ,
118+ callback : async ( ) => {
119+ await deepLinkManager . treatLink ( ) ;
120+ } ,
121+ } ) ;
117122
118123 this . isMainScreen = ! this . mainTabs ?. outlet . canGoBack ( ) ;
119124 this . updateVisibility ( ) ;
@@ -213,12 +218,7 @@ export class CoreMainMenuPage implements OnInit, OnDestroy {
213218 // Use navigate instead of mainTabs.select to be able to pass page params.
214219 CoreNavigator . navigateToSitePath ( tabPage , {
215220 preferCurrentTab : false ,
216- params : {
217- urlToOpen : this . urlToOpen ,
218- redirectPath : this . redirectPath ,
219- redirectOptions : this . redirectOptions ,
220- ...tabPageParams ,
221- } ,
221+ params : tabPageParams ,
222222 } ) ;
223223 }
224224 }
0 commit comments