From bb7ae64332d5883aba45db32880fb9b61f4f7b98 Mon Sep 17 00:00:00 2001 From: kulgg <75735874+kulgg@users.noreply.github.com> Date: Wed, 28 Feb 2024 14:29:49 +0100 Subject: [PATCH] . --- .../catalog-page/state/catalog-page-state.ts | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/app/routes/broker-ui/catalog-page/state/catalog-page-state.ts b/src/app/routes/broker-ui/catalog-page/state/catalog-page-state.ts index eb38e7d90..2e67202d6 100644 --- a/src/app/routes/broker-ui/catalog-page/state/catalog-page-state.ts +++ b/src/app/routes/broker-ui/catalog-page/state/catalog-page-state.ts @@ -104,22 +104,21 @@ export class CatalogPageState implements OnDestroy { @Action(CatalogPage.AddFilterBox) onAddFilterBox(ctx: Ctx, action: CatalogPage.AddFilterBox) { - let state = ctx.getState(); + const state = ctx.getState(); if (action.filterBox.id in state.filters) { return; } - - state = { - ...state, - filters: { - ...state.filters, - [action.filterBox.id]: FilterBoxVisibleState.buildVisibleState( - action.filterBox, - ), - }, - }; - state = this._recalculateActiveFilterItems(state); - ctx.setState(state); + ctx.setState( + this._recalculateActiveFilterItems({ + ...state, + filters: { + ...state.filters, + [action.filterBox.id]: FilterBoxVisibleState.buildVisibleState( + action.filterBox, + ), + }, + }), + ); } @Action(CatalogPage.UpdateFilterSelectedItems)