diff --git a/src/app/components/cancelar-compra/cancelar-compra.component.ts b/src/app/components/cancelar-compra/cancelar-compra.component.ts index 2d9ba68..b0a9b44 100644 --- a/src/app/components/cancelar-compra/cancelar-compra.component.ts +++ b/src/app/components/cancelar-compra/cancelar-compra.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { appSettings } from 'src/etc/AppSettings'; import { Location } from '@angular/common'; import { Router } from '@angular/router'; +import { ProductoService } from 'src/app/services/producto.service'; @Component({ selector: 'app-cancelar-compra', @@ -14,10 +15,15 @@ export class CancelarCompraComponent implements OnInit { constructor( private location: Location, - private router: Router + private router: Router, + private productoService : ProductoService ) { } ngOnInit() { + + setTimeout(() => { + this.limpiarCarritoYvolver(); + }, 30000) } volverPreviousPage() { @@ -27,6 +33,9 @@ export class CancelarCompraComponent implements OnInit { limpiarCarritoYvolver(){ + this.productoService.productoAcargar = undefined; + this.productoService.promoAcargar = undefined; + this.productoService.productos = []; this.router.navigate(['/home']); }