diff --git a/src/app/components/master/master.component.html b/src/app/components/master/master.component.html index a6c09d6..c4e74a3 100644 --- a/src/app/components/master/master.component.html +++ b/src/app/components/master/master.component.html @@ -1,4 +1,6 @@ -
+
diff --git a/src/app/components/master/master.component.ts b/src/app/components/master/master.component.ts index 0fbe076..726d088 100644 --- a/src/app/components/master/master.component.ts +++ b/src/app/components/master/master.component.ts @@ -1,15 +1,40 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { Router } from '@angular/router'; @Component({ selector: 'app-master', templateUrl: './master.component.html', styleUrls: ['./master.component.scss'] }) -export class MasterComponent implements OnInit { +export class MasterComponent implements OnInit, OnDestroy { - constructor() { } + private timerReposo: any + + constructor( + private router: Router + ) { } ngOnInit() { + + this.timerReposo = setTimeout(() => { + + this.router.navigate(['cancelar-compra']); + }, 90000) + } + + ngOnDestroy() { + + clearTimeout(this.timerReposo); + } + + reiniciarTimer() { + + clearTimeout(this.timerReposo); + this.timerReposo = setTimeout(() => { + + this.router.navigate(['cancelar-compra']); + }, 90000) + } }