diff --git a/src/app/components/configuracion/configuracion.component.ts b/src/app/components/configuracion/configuracion.component.ts index 39ee282..4727147 100644 --- a/src/app/components/configuracion/configuracion.component.ts +++ b/src/app/components/configuracion/configuracion.component.ts @@ -5,6 +5,7 @@ import { PuntoVenta } from 'src/app/wrappers/puntoVenta'; import { ImpresoraService } from 'src/app/services/impresora.service'; import { Impresora } from 'src/app/wrappers/impresora'; import { FormGroup, FormControl } from '@angular/forms'; +import { Router } from '@angular/router'; @Component({ selector: 'app-configuracion', @@ -16,11 +17,13 @@ export class ConfiguracionComponent implements OnInit { puntosVenta: PuntoVenta[] = []; impresoras: Impresora[] = []; form: FormGroup; + reiniciar: boolean = false; constructor( private activeModal: BsModalRef, private puntoVentaService: PuntoVentaService, private impresoraService: ImpresoraService, + private router: Router ) { } ngOnInit() { @@ -50,9 +53,13 @@ export class ConfiguracionComponent implements OnInit { close() { this.activeModal.hide(); + if (this.reiniciar) { + this.router.navigate(['inicio']); + } } acept() { + this.reiniciar = !localStorage.getItem('impresoraPVE') ? true : false; let auxPuntoVenta = this.puntosVenta.find(p => p.ID === this.form.get('puntoVenta').value); let auxImpresora = this.impresoras.find(p => p.PVE === this.form.get('impresora').value); diff --git a/src/app/components/inicio/inicio.component.html b/src/app/components/inicio/inicio.component.html index b92d7ac..a3a449f 100644 --- a/src/app/components/inicio/inicio.component.html +++ b/src/app/components/inicio/inicio.component.html @@ -1,4 +1,4 @@ -
No esá configurado el punto de venta
+