@wizishop/angular-components 14.4.57 → 14.4.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2575,17 +2575,21 @@ class HistoryService {
2575
2575
  registerHistory() {
2576
2576
  this.router.events.subscribe((event) => {
2577
2577
  if (event instanceof NavigationEnd) {
2578
- this.history.push(event.urlAfterRedirects);
2578
+ if (this.history.length > 0 && this.history[this.history.length - 1] === event.urlAfterRedirects.split('?')[0]) {
2579
+ return;
2580
+ }
2581
+ this.history.push(event.urlAfterRedirects.split('?')[0]);
2579
2582
  console.log('history', this.history);
2580
2583
  }
2581
2584
  });
2582
2585
  }
2583
2586
  back(link) {
2584
- const lastlink = this.history[this.history.length - 1];
2585
- console.log('back', lastlink);
2587
+ console.log('back', this.history);
2586
2588
  this.history.pop();
2587
- if (this.history.length > 0 && lastlink) {
2588
- this.router.navigate([lastlink]);
2589
+ if (this.history.length > 0) {
2590
+ const lastlink = this.history[this.history.length - 1];
2591
+ console.log('lastlink', lastlink);
2592
+ this.router.navigate(lastlink.split('/'));
2589
2593
  }
2590
2594
  else {
2591
2595
  this.redirect(link);