diff options
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.ts | 8 |
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 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, CanDeactivate, RouterStateSnapshot } from '@angular/router' | 2 | import { CanDeactivate } from '@angular/router' |
3 | import { Observable } from 'rxjs' | 3 | import { Observable } from 'rxjs' |
4 | import { ConfirmService } from '../../core/index' | 4 | import { ConfirmService } from '../../core/index' |
5 | import { I18n } from '@ngx-translate/i18n-polyfill' | 5 | import { 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 | ||