Skip to content

Commit

Permalink
fix(atomic/commerce): fix url manager (#4151)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeaudoincoveo authored Jul 8, 2024
1 parent eaef9fa commit d5991f5
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ export class AtomicCommerceInterface

this.initRequestStatus();
this.initSummary();
this.initUrlManager();
this.initContext();
this.initLanguage();
this.initUrlManager();
this.initialized = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ export class AtomicCommerceProductList
public initialize() {
if (this.bindings.interfaceElement.type === 'product-listing') {
this.productListing = buildProductListing(this.bindings.engine);
this.productListing.refresh();
this.summary = this.productListing.summary();
} else {
this.search = buildSearch(this.bindings.engine);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
const commerceInterface = document.querySelector('atomic-commerce-interface');

await commerceInterface.initializeWithEngine(commerceEngine);

commerceInterface.executeFirstRequest();
})();
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
const commerceInterface = document.querySelector('atomic-commerce-interface');

await commerceInterface.initializeWithEngine(commerceEngine);

commerceInterface.executeFirstRequest();
})();
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
const commerceInterface = document.querySelector('atomic-commerce-interface');

await commerceInterface.initializeWithEngine(commerceEngine);

commerceInterface.executeFirstRequest();
})();
</script>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ export const paginationReducer = createReducer(

state.recommendations[slotId] = getCommercePaginationInitialSlice();
})
.addCase(restoreSearchParameters, handleRestoreParameters)
.addCase(restoreProductListingParameters, handleRestoreParameters)
.addCase(clearAllCoreFacets, handlePaginationReset)
.addCase(deselectAllValuesInCoreFacet, handlePaginationReset)
.addCase(toggleSelectFacetValue, handlePaginationReset)
Expand All @@ -118,7 +116,9 @@ export const paginationReducer = createReducer(
.addCase(toggleSelectCategoryFacetValue, handlePaginationReset)
.addCase(applySort, handlePaginationReset)
.addCase(setContext, handlePaginationReset)
.addCase(setView, handlePaginationReset);
.addCase(setView, handlePaginationReset)
.addCase(restoreSearchParameters, handleRestoreParameters)
.addCase(restoreProductListingParameters, handleRestoreParameters);
}
);

Expand Down
6 changes: 3 additions & 3 deletions packages/headless/src/features/commerce/sort/sort-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export const sortReducer = createReducer(
})
.addCase(fetchProductListing.fulfilled, handleFetchFulfilled)
.addCase(executeSearch.fulfilled, handleFetchFulfilled)
.addCase(restoreSearchParameters, handleRestoreParameters)
.addCase(restoreProductListingParameters, handleRestoreParameters)
.addCase(setContext, getCommerceSortInitialState)
.addCase(setView, getCommerceSortInitialState);
.addCase(setView, getCommerceSortInitialState)
.addCase(restoreSearchParameters, handleRestoreParameters)
.addCase(restoreProductListingParameters, handleRestoreParameters);
}
);

Expand Down

0 comments on commit d5991f5

Please sign in to comment.