@@ -17,9 +17,9 @@ export class AppComponent {
1717 loggedIn = false ;
1818
1919 constructor ( private matIconRegistry : MatIconRegistry ,
20- private domSanitizer : DomSanitizer ,
21- private route : ActivatedRoute ,
22- private router : Router , public authService : AuthService ) {
20+ private domSanitizer : DomSanitizer ,
21+ private route : ActivatedRoute ,
22+ private router : Router , public authService : AuthService ) {
2323 this . matIconRegistry . addSvgIcon (
2424 'project' ,
2525 this . domSanitizer . bypassSecurityTrustResourceUrl ( '../assets/images/project.svg' )
@@ -120,8 +120,12 @@ export class AppComponent {
120120 if ( ! this . authService . isTokenExpired ( ) ) {
121121 this . loggedIn = true ;
122122 if ( localStorage . getItem ( 'jwt_token' ) === 'no_token' && window . location . href . split ( '/' ) . pop ( ) !== 'applications' && window . location . href . split ( '/' ) . pop ( ) !== 'home' && window . location . href . split ( '/' ) . pop ( ) !== '' ) {
123- sessionStorage . setItem ( 'appParamExists' , 'Y' ) ;
124- this . router . navigate ( [ 'applications' , { app : window . location . href . split ( '/' ) . pop ( ) } ] ) ;
123+ if ( window . location . href . split ( '/' ) . slice ( - 2 ) [ 0 ] !== 'home' && window . location . href . split ( '/' ) . slice ( - 2 ) [ 0 ] !== 'conversations' && window . location . href . split ( '/' ) . slice ( - 2 ) [ 0 ] !== 'trainer' ) {
124+ sessionStorage . setItem ( 'appParamExists' , 'Y' ) ;
125+ this . router . navigate ( [ 'applications' , { app : window . location . href . split ( '/' ) . pop ( ) } ] ) ;
126+ } else {
127+ sessionStorage . setItem ( 'appParamExists' , 'N' ) ;
128+ }
125129 } else {
126130 sessionStorage . setItem ( 'appParamExists' , 'N' ) ;
127131 this . router . navigate ( [ 'applications' ] ) ;
@@ -131,9 +135,9 @@ export class AppComponent {
131135 }
132136 }
133137
134- callParentApp ( ) {
138+ callParentApp ( ) {
135139 localStorage . clear ( ) ;
136- let url = environment . PARENT_APP_URL ;
140+ let url = environment . PARENT_APP_URL ;
137141 window . open ( url , '_self' ) ;
138142 }
139143}
0 commit comments