app.component.ts
969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { Component, OnInit } from '@angular/core';
import { Router, RouterModule, RoutesRecognized, RouterLink, RouterState, ActivatedRoute, RouterLinkActive } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
title = 'autoservicio-axion';
timerReposo: any;
constructor(
private router: Router,
) { }
ngOnInit(): void {
if (
window.location.href !== 'http://localhost:4206/#/' &&
window.location.href !== 'http://localhost:4206/#/comanda' &&
window.location.href !== 'http://localhost:4206/#/pedidos-salientes'
) {
this.startTimeOutInactividad();
};
}
restartTimer() {
clearTimeout(this.timerReposo);
this.startTimeOutInactividad();
}
startTimeOutInactividad() {
setTimeout(() => {
this.router.navigate(['cancelar-compra']);
}, 1000);
}
}