Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Force currentTab to be always opened

dominik-zeglene934bf4cf4db
diff --git a/saleor/static/dashboard-next/products/components/ProductListFilter/ProductListFilter.tsx b/saleor/static/dashboard-next/products/components/ProductListFilter/ProductListFilter.tsx
index d191fa51ff..79d54ae826 100644
--- a/saleor/static/dashboard-next/products/components/ProductListFilter/ProductListFilter.tsx
+++ b/saleor/static/dashboard-next/products/components/ProductListFilter/ProductListFilter.tsx
@@ -30,19 +30,17 @@ const ProductListFilter: React.StatelessComponent<ProductListFilterProps> = ({
<FilterTab label={i18n.t("All Products")} onClick={onAllProducts} />
<FilterTab label={i18n.t("Availiable")} onClick={onAvailable} />
<FilterTab label={i18n.t("Out Of Stock")} onClick={onOfStock} />
- {(currentTab === 0 || undefined) &&
- filtersList &&
- filtersList.length > 0 && (
- <FilterTab
- onClick={onCustomFilter}
- value={0}
- label={i18n.t("Custom Filter")}
- />
- )}
+ {currentTab === 0 && filtersList && filtersList.length > 0 && (
+ <FilterTab
+ onClick={onCustomFilter}
+ value={0}
+ label={i18n.t("Custom Filter")}
+ />
+ )}
</FilterTabs>
- {(currentTab === 0 || undefined) &&
- filtersList &&
- filtersList.length > 0 && <FilterChip filtersList={filtersList} />}
+ {currentTab === 0 && filtersList && filtersList.length > 0 && (
+ <FilterChip filtersList={filtersList} />
+ )}
</>
);
ProductListFilter.displayName = "ProductListFilter";