Skip to content

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

Replace ES7 functions

Marcin Gębala85d9e4fa0f68
diff --git a/saleor/static/js/components/categoryPage/ProductFilters.js b/saleor/static/js/components/categoryPage/ProductFilters.js
index f7e177a637..d6d17e909a 100644
--- a/saleor/static/js/components/categoryPage/ProductFilters.js
+++ b/saleor/static/js/components/categoryPage/ProductFilters.js
@@ -58,12 +58,13 @@ class ProductFilters extends Component {
<ul id={attribute.name}>
{attribute.values.map((value) => {
const key = this.getFilterKey(attribute.name, value.slug);
- if (visibility[attribute.name] || checkedAttributes.includes(key)) {
+ const isKeyChecked = checkedAttributes.indexOf(key) > -1;
+ if (visibility[attribute.name] || isKeyChecked) {
return (
<li key={value.id} className="item">
<AttributeInput
attribute={attribute}
- checked={checkedAttributes.includes(key)}
+ checked={isKeyChecked}
onClick={this.onClick}
value={value}
/>
diff --git a/saleor/static/js/components/categoryPage/utils.js b/saleor/static/js/components/categoryPage/utils.js
index c878aae3da..fc4af715c4 100644
--- a/saleor/static/js/components/categoryPage/utils.js
+++ b/saleor/static/js/components/categoryPage/utils.js
@@ -11,7 +11,7 @@ export const getAttributesFromQuery = (exclude) => {
const urlParams = queryString.parse(location.search);
let attributes = [];
Object.keys(urlParams).forEach(key => {
- if (!exclude.includes(key)) {
+ if (exclude.indexOf(key) === -1) {
if (Array.isArray(urlParams[key])) {
const values = urlParams[key];
values.map((valueSlug) => {