[HIMA-258] when on cart confirmation page closing tab does not show the asking popup

This commit is contained in:
Eraldo Hasanaj
2019-08-08 13:48:03 +02:00
parent 974b4a1f20
commit 6d7cf18419

View File

@@ -1,6 +1,6 @@
import { Component, OnInit, Input, ViewChild, OnDestroy, ChangeDetectionStrategy, ChangeDetectorRef, AfterViewInit } from '@angular/core';
import { Process } from '../../core/models/process.model';
import { Router } from '@angular/router';
import { Router, ActivatedRoute } from '@angular/router';
import { Store, Select } from '@ngxs/store';
import {
DeleteProcess,
@@ -58,7 +58,8 @@ export class ProcessTabComponent implements OnInit, OnDestroy, AfterViewInit {
cartCount = 0;
cartanimation = '';
constructor(private store: Store, private router: Router, private cdr: ChangeDetectorRef) {}
constructor(private store: Store, private router: Router, private cdr: ChangeDetectorRef, route: ActivatedRoute) {}
isProcessFinished = this.router.url === '/cart/confirmation';
deleteProcess(process: Process) {
this.store.dispatch(new DeleteProcess(process));
@@ -81,7 +82,7 @@ export class ProcessTabComponent implements OnInit, OnDestroy, AfterViewInit {
}
openDeleteConfirmationDialog() {
if (this.process.closeDirectlyTab) {
if (this.process.closeDirectlyTab || this.isProcessFinished) {
this.deleteProcess(this.process);
} else {
this.processDeleteDialogComponent.openDialog();