Commit 536f87abe2a286d6aaac27657e258561dbe58b1c
1 parent
900dccb8b9
Exists in
master
and in
1 other branch
Cambiado tiempo de timer.
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/app/components/mensaje-final/mensaje-final.component.ts
| 1 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
| 2 | import { appSettings } from 'src/etc/AppSettings'; | 2 | import { appSettings } from 'src/etc/AppSettings'; |
| 3 | import { ProductoService } from 'src/app/services/producto.service'; | 3 | import { ProductoService } from 'src/app/services/producto.service'; |
| 4 | import { Router } from '@angular/router'; | 4 | import { Router } from '@angular/router'; |
| 5 | 5 | ||
| 6 | @Component({ | 6 | @Component({ |
| 7 | selector: 'app-mensaje-final', | 7 | selector: 'app-mensaje-final', |
| 8 | templateUrl: './mensaje-final.component.html', | 8 | templateUrl: './mensaje-final.component.html', |
| 9 | styleUrls: ['./mensaje-final.component.scss'] | 9 | styleUrls: ['./mensaje-final.component.scss'] |
| 10 | }) | 10 | }) |
| 11 | export class MensajeFinalComponent implements OnInit { | 11 | export class MensajeFinalComponent implements OnInit { |
| 12 | 12 | ||
| 13 | private apiUrl: string = appSettings.apiUrl; | 13 | private apiUrl: string = appSettings.apiUrl; |
| 14 | private timer: any; | 14 | private timer: any; |
| 15 | 15 | ||
| 16 | constructor( | 16 | constructor( |
| 17 | private productoService: ProductoService, | 17 | private productoService: ProductoService, |
| 18 | private router: Router | 18 | private router: Router |
| 19 | ) { } | 19 | ) { } |
| 20 | 20 | ||
| 21 | ngOnInit() { | 21 | ngOnInit() { |
| 22 | 22 | ||
| 23 | this.timer = setTimeout(() => { | 23 | this.timer = setTimeout(() => { |
| 24 | 24 | ||
| 25 | this.limpiarCarritoYvolver(); | 25 | this.limpiarCarritoYvolver(); |
| 26 | }, 30000) | 26 | }, 3000) |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | ngOnDestroy() { | 29 | ngOnDestroy() { |
| 30 | 30 | ||
| 31 | clearTimeout(this.timer); | 31 | clearTimeout(this.timer); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | limpiarCarritoYvolver() { | 34 | limpiarCarritoYvolver() { |
| 35 | 35 | ||
| 36 | this.productoService.productoAcargar = undefined; | 36 | this.productoService.productoAcargar = undefined; |
| 37 | this.productoService.promoAcargar = undefined; | 37 | this.productoService.promoAcargar = undefined; |
| 38 | this.productoService.productos = []; | 38 | this.productoService.productos = []; |
| 39 | this.router.navigate(['/home']); | 39 | this.router.navigate(['/home']); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | } | 42 | } |
| 43 | 43 |