aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/guards/can-deactivate-guard.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/guards/can-deactivate-guard.service.ts')
-rw-r--r--client/src/app/shared/guards/can-deactivate-guard.service.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/client/src/app/shared/guards/can-deactivate-guard.service.ts b/client/src/app/shared/guards/can-deactivate-guard.service.ts
index c038a5c0e..e2a79e8c4 100644
--- a/client/src/app/shared/guards/can-deactivate-guard.service.ts
+++ b/client/src/app/shared/guards/can-deactivate-guard.service.ts
@@ -1,5 +1,5 @@
1import { Injectable } from '@angular/core' 1import { Injectable } from '@angular/core'
2import { ActivatedRouteSnapshot, CanDeactivate, RouterStateSnapshot } from '@angular/router' 2import { CanDeactivate } from '@angular/router'
3import { Observable } from 'rxjs' 3import { Observable } from 'rxjs'
4import { ConfirmService } from '../../core/index' 4import { ConfirmService } from '../../core/index'
5import { I18n } from '@ngx-translate/i18n-polyfill' 5import { I18n } from '@ngx-translate/i18n-polyfill'
@@ -15,11 +15,7 @@ export class CanDeactivateGuard implements CanDeactivate<CanComponentDeactivate>
15 private i18n: I18n 15 private i18n: I18n
16 ) { } 16 ) { }
17 17
18 canDeactivate (component: CanComponentDeactivate, 18 canDeactivate (component: CanComponentDeactivate) {
19 currentRoute: ActivatedRouteSnapshot,
20 currentState: RouterStateSnapshot,
21 nextState: RouterStateSnapshot
22 ) {
23 const result = component.canDeactivate() 19 const result = component.canDeactivate()
24 const text = result.text || this.i18n('All unsaved data will be lost, are you sure you want to leave this page?') 20 const text = result.text || this.i18n('All unsaved data will be lost, are you sure you want to leave this page?')
25 21