From aeda10fccebdac96707921f0361af91ef84d4990 Mon Sep 17 00:00:00 2001 From: tkostuch Date: Wed, 26 Feb 2020 15:20:01 +0100 Subject: [PATCH 1/2] keep old category before route is resolved --- core/modules/catalog-next/store/category/getters.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/modules/catalog-next/store/category/getters.ts b/core/modules/catalog-next/store/category/getters.ts index c276ae7eaa..a7463a735e 100644 --- a/core/modules/catalog-next/store/category/getters.ts +++ b/core/modules/catalog-next/store/category/getters.ts @@ -44,7 +44,7 @@ const getters: GetterTree = { }) || {} }, getCurrentCategory: (state, getters, rootState, rootGetters) => { - return getters.getCategoryByParams(rootGetters['url/getCurrentRoute'].params) + return getters.getCategoryByParams(rootState.route.params) }, getAvailableFiltersFrom: (state, getters, rootState) => (aggregations) => { const filters = {} @@ -115,12 +115,12 @@ const getters: GetterTree = { const categoryId = get(getters.getCurrentCategory, 'id', null) return state.filtersMap[categoryId] || {} }, - getCurrentFiltersFrom: (state, getters, rootState, rootGetters) => (filters, categoryFilters) => { - const currentQuery = filters || rootGetters['url/getCurrentRoute'][products.routerFiltersSource] + getCurrentFiltersFrom: (state, getters, rootState) => (filters, categoryFilters) => { + const currentQuery = filters || rootState.route[products.routerFiltersSource] const availableFilters = categoryFilters || getters.getAvailableFilters return getFiltersFromQuery({availableFilters, filtersQuery: currentQuery}) }, - getCurrentSearchQuery: (state, getters, rootState, rootGetters) => getters.getCurrentFiltersFrom(rootGetters['url/getCurrentRoute'][products.routerFiltersSource]), + getCurrentSearchQuery: (state, getters, rootState) => getters.getCurrentFiltersFrom(rootState.route[products.routerFiltersSource]), getCurrentFilters: (state, getters) => getters.getCurrentSearchQuery.filters, hasActiveFilters: (state, getters) => !!Object.keys(getters.getCurrentFilters).length, getSystemFilterNames: () => products.systemFilterNames, From d8a95a508ffb3811b0ba305e9fe714b560088b35 Mon Sep 17 00:00:00 2001 From: tkostuch Date: Thu, 27 Feb 2020 06:55:28 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40428d2a6b..9400f03af2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Disable overriding `route` state in __INITIAL_STATE__ - @gibkigonzo (pr#4095) - Fix gtm order placement event when user was guest - @Michal-Dziedzinski (#4064) - Fix gtm event switched properties - @Michal-Dziedzinski (pr#4106) +- Keep old category before route is resolved - @gibkigonzo (pr#4124) ## [1.11.1] - 2020.02.05