From 0bdaea4ac2c803759d1aaa188cf665f1d3bafac9 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Wed, 15 Jan 2020 16:48:13 -0300 Subject: [PATCH] cambio a hijos de adminComponent el reset de la compra --- src/app/app.component.html | 4 +-- src/app/app.component.ts | 31 ++-------------------- src/app/modules/admin/admin.component.html | 2 +- src/app/modules/admin/admin.component.ts | 21 +++++++++++++-- .../cancelar-compra/cancelar-compra.component.html | 2 +- 5 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 7972b71..0680b43 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,3 +1 @@ -
- -
+ diff --git a/src/app/app.component.ts b/src/app/app.component.ts index fe85b24..459968a 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,37 +1,10 @@ -import { Component, OnInit } from '@angular/core'; -import { Router, RouterModule, RoutesRecognized, RouterLink, RouterState, ActivatedRoute, RouterLinkActive } from '@angular/router'; +import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) -export class AppComponent implements OnInit { +export class AppComponent { 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); - } } diff --git a/src/app/modules/admin/admin.component.html b/src/app/modules/admin/admin.component.html index 2a55adb..a0c5865 100644 --- a/src/app/modules/admin/admin.component.html +++ b/src/app/modules/admin/admin.component.html @@ -1,4 +1,4 @@ - +
diff --git a/src/app/modules/admin/admin.component.ts b/src/app/modules/admin/admin.component.ts index 6900e61..f951391 100644 --- a/src/app/modules/admin/admin.component.ts +++ b/src/app/modules/admin/admin.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; @Component({ selector: 'app-admin', @@ -6,9 +7,25 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./admin.component.scss'] }) export class AdminComponent implements OnInit { + timerReposo: any; - constructor() { } + constructor( + private router: Router, + ) { } - ngOnInit() { } + ngOnInit() { + this.startTimeOutInactividad(); + } + + restartTimer() { + clearTimeout(this.timerReposo); + this.startTimeOutInactividad(); + } + + startTimeOutInactividad() { + setTimeout(() => { + this.router.navigate(['cancelar-compra']); + }, 5000); + } } diff --git a/src/app/modules/cancelar-compra/cancelar-compra.component.html b/src/app/modules/cancelar-compra/cancelar-compra.component.html index 6650233..dcd26d0 100644 --- a/src/app/modules/cancelar-compra/cancelar-compra.component.html +++ b/src/app/modules/cancelar-compra/cancelar-compra.component.html @@ -2,7 +2,7 @@
-
+
NECESITA

más tiempo

-- 1.9.1