From f6a043df74bc755de8e658ba76a4e55980b96f66 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 25 Jan 2018 19:01:13 +0100 Subject: Improve video upload guard a little bit --- .../src/app/shared/can-deactivate-guard.service.ts | 25 ---------------------- 1 file changed, 25 deletions(-) delete mode 100644 client/src/app/shared/can-deactivate-guard.service.ts (limited to 'client/src/app/shared/can-deactivate-guard.service.ts') diff --git a/client/src/app/shared/can-deactivate-guard.service.ts b/client/src/app/shared/can-deactivate-guard.service.ts deleted file mode 100644 index 4239df737..000000000 --- a/client/src/app/shared/can-deactivate-guard.service.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Injectable } from '@angular/core' -import { CanDeactivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router' -import { Observable } from 'rxjs/Observable' -import { ConfirmService } from '../core' - -export interface CanComponentDeactivate { - canDeactivate: () => Observable | boolean -} - -@Injectable() -export class CanDeactivateGuard implements CanDeactivate { - constructor (private confirmService: ConfirmService) { } - - canDeactivate (component: CanComponentDeactivate, - currentRoute: ActivatedRouteSnapshot, - currentState: RouterStateSnapshot, - nextState: RouterStateSnapshot - ): Observable | boolean { - return component.canDeactivate() || this.confirmService.confirm( - 'All unsaved data will be lost, are you sure you want to leave ?', - 'Unsaved Data' - ) - } - -} -- cgit v1.2.3