Skip to content

Commit

Permalink
fix(admin-ui): Fix navigation to order list component
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Mar 16, 2023
1 parent e6f8584 commit 9b4821e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import { Injectable, OnDestroy } from '@angular/core';
import { ActivatedRoute, Data, NavigationEnd, Params, PRIMARY_OUTLET, Router } from '@angular/router';
import { DataService } from '@vendure/admin-ui/core';
import { flatten } from 'lodash';
import { combineLatest as observableCombineLatest, Observable, of as observableOf, Subject } from 'rxjs';
import {
combineLatest as observableCombineLatest,
Observable,
of as observableOf,
share,
Subject,
} from 'rxjs';
import { filter, map, startWith, switchMap, takeUntil } from 'rxjs/operators';

export type BreadcrumbString = string;
Expand Down Expand Up @@ -33,6 +39,7 @@ export class BreadcrumbService implements OnDestroy {
takeUntil(this.destroy$),
startWith(true),
switchMap(() => this.generateBreadcrumbs(this.route.root)),
share(),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ export class OrderListComponent
this.route.snapshot.queryParamMap.get('filter') || 'open',
),
);
const lastFilters = this.localStorageService.get('orderListLastCustomFilters');
if (lastFilters) {
this.setQueryParam(lastFilters, { replaceUrl: true });
}
this.canCreateDraftOrder = !!this.serverConfigService
.getOrderProcessStates()
.find(state => state.name === 'Created')
Expand All @@ -130,6 +126,10 @@ export class OrderListComponent

ngOnInit() {
super.ngOnInit();
const lastFilters = this.localStorageService.get('orderListLastCustomFilters');
if (lastFilters) {
this.setQueryParam(lastFilters, { replaceUrl: true });
}
this.activePreset$ = this.route.queryParamMap.pipe(
map(qpm => qpm.get('filter') || 'open'),
distinctUntilChanged(),
Expand Down

0 comments on commit 9b4821e

Please sign in to comment.