From 7f448d78d17f2db43e5a22d87e352db97a11dedf Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 22 Oct 2018 16:27:09 +0100 Subject: [PATCH] [ADF-3685] Close all dialog when redirect after 401 to demo shell --- demo-shell/src/app/app.component.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/demo-shell/src/app/app.component.ts b/demo-shell/src/app/app.component.ts index d97ecb34b8..6fceae8c50 100644 --- a/demo-shell/src/app/app.component.ts +++ b/demo-shell/src/app/app.component.ts @@ -18,6 +18,7 @@ import { Component, ViewEncapsulation, OnInit } from '@angular/core'; import { AuthenticationService, AlfrescoApiService, PageTitleService } from '@alfresco/adf-core'; import { Router } from '@angular/router'; +import { MatDialog } from '@angular/material'; @Component({ selector: 'app-root', @@ -30,7 +31,8 @@ export class AppComponent implements OnInit { constructor(private pageTitleService: PageTitleService, private alfrescoApiService: AlfrescoApiService, private authenticationService: AuthenticationService, - private router: Router) { + private router: Router, + private dialogRef: MatDialog) { } ngOnInit() { @@ -39,6 +41,7 @@ export class AppComponent implements OnInit { this.alfrescoApiService.getInstance().on('error', (error) => { if (error.status === 401) { if (!this.authenticationService.isLoggedIn()) { + this.dialogRef.closeAll(); this.router.navigate(['/login']); } }