Skip to content

Commit

Permalink
fix(query-preview): fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lauramargar committed Jan 15, 2024
1 parent 52f2206 commit b7a39a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
8 changes: 0 additions & 8 deletions packages/x-components/src/views/home/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -633,14 +633,6 @@
extraParams: { store: 'Gijón' },
filters: ['categoryIds:66dd06d9f']
},
{
query: 'charger'
//filters: ['categoryIds:7d6e18d0f']
},
{
query: 'summer dress',
filters: ['brand:marni']
},
{
query: 'summer dress',
filters: ['categoryIds:5b612edb5', 'brand:marni']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,17 @@ export const queriesPreviewXStoreModule: QueriesPreviewXStoreModule = {
setConfig,
mergeConfig,
addQueryPreviewInstance(state, query: string) {
state.queriesPreview[query].instances += 1;
if (state.queriesPreview[query]) {
state.queriesPreview[query].instances += 1;
}
},
removeQueryPreviewInstance(state, { query, cache }: { query: string; cache: boolean }) {
state.queriesPreview[query].instances -= 1;
if (!cache && state.queriesPreview[query].instances === 0) {
Vue.delete(state.queriesPreview, query);
if (state.queriesPreview[query]) {
state.queriesPreview[query].instances -= 1;

if (!cache && state.queriesPreview[query].instances === 0) {
Vue.delete(state.queriesPreview, query);
}
}
}
},
Expand Down

0 comments on commit b7a39a2

Please sign in to comment.