Skip to content
Snippets Groups Projects
Verified Commit 7677b599 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #13670 TIME 1:10 Clear interval + fix logout from process page

parent 4e2fe152
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,12 @@ export class ActionsService {
) {
}
ngOnDestroy(): void {
if (this.currentResourceLock) {
clearInterval(this.currentResourceLock);
}
}
catchAction(): Observable<any> {
return this.eventAction.asObservable();
}
......
......@@ -672,6 +672,9 @@ export class TemplateAdministrationComponent implements OnInit, OnDestroy {
ngOnDestroy() {
tinymce.remove('textarea');
if (this.intervalLockFile) {
clearInterval(this.intervalLockFile);
}
}
}
@Component({
......
......@@ -683,6 +683,9 @@ export class ProcessComponent implements OnInit {
}
ngOnDestroy() {
if (this.currentResourceLock) {
clearInterval(this.currentResourceLock);
}
// unsubscribe to ensure no memory leaks
this.subscription.unsubscribe();
}
......
......@@ -600,6 +600,10 @@ export class SignatureBookComponent implements OnInit {
}
ngOnDestroy() {
if (this.currentResourceLock) {
clearInterval(this.currentResourceLock);
}
// unsubscribe to ensure no memory leaks
this.subscription.unsubscribe();
}
......
......@@ -208,6 +208,12 @@ export class DocumentViewerComponent implements OnInit {
}
}
ngOnDestroy() {
if (this.intervalLockFile) {
clearInterval(this.intervalLockFile);
}
}
loadFileFromBase64() {
this.loading = true;
this.file = {
......
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, CanDeactivate } from '@angular/router';
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, CanDeactivate, UrlTree } from '@angular/router';
import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { map, tap, catchError, exhaustMap, filter } from 'rxjs/operators';
......@@ -181,8 +181,8 @@ export class AppGuard implements CanActivate {
export class AfterProcessGuard implements CanDeactivate<ProcessComponent> {
constructor() { }
async canDeactivate(component: ProcessComponent): Promise<boolean> {
if (!component.isActionEnded() && !component.detailMode) {
async canDeactivate(component: ProcessComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState: RouterStateSnapshot): Promise<boolean> {
if (nextState.url != '/login' && !component.isActionEnded() && !component.detailMode) {
component.unlockResource();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment