From feebe02a0948430aaac007fde32e47413206fc20 Mon Sep 17 00:00:00 2001 From: Nicole Emer Date: Fri, 6 Sep 2024 17:00:54 +0200 Subject: [PATCH] Problem: indexof() do not catch the substr item in SUB_DOMAINS Solution: switch to some --- extensions/cmp/cmp_custom_vendor_mapping.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/cmp/cmp_custom_vendor_mapping.js b/extensions/cmp/cmp_custom_vendor_mapping.js index 9829a356..be1454fb 100644 --- a/extensions/cmp/cmp_custom_vendor_mapping.js +++ b/extensions/cmp/cmp_custom_vendor_mapping.js @@ -4,12 +4,12 @@ const SUB_DOMAINS = ['sportbild', 'shop.welt.de', 'bildplusshop.bild.de']; const CLUB_DOMAIN = ['club']; - const NEW_STORAGE_KEY = (CLUB_DOMAIN.indexOf(window.location.hostname) >-1) ? - 'cmp_cv_list_club' : - (SUB_DOMAINS.indexOf(window.location.hostname) >-1 ? - 'cm_cv_list' : - 'cmp_cv_list' - ); + const NEW_STORAGE_KEY = (CLUB_DOMAIN.some(domain => window.location.hostname.includes(domain))) ? + 'cmp_cv_list_club' : + (SUB_DOMAINS.some(domain => window.location.hostname.includes(domain)) ? + 'cm_cv_list' : + 'cmp_cv_list' + ); // Vendor Array for Bild and Welt const vendorArray = [