From d23921312b87dbd27f9d6706495b3ae688148a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Luba=C5=84ski?= Date: Tue, 6 Feb 2024 14:37:44 +0100 Subject: [PATCH] Fix default values for storage migration from v8 (#1465) --- extension-manifest-v3/src/store/options.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/extension-manifest-v3/src/store/options.js b/extension-manifest-v3/src/store/options.js index 21b950100..8712d056f 100644 --- a/extension-manifest-v3/src/store/options.js +++ b/extension-manifest-v3/src/store/options.js @@ -229,9 +229,9 @@ async function migrateFromMV2() { // Proceed if the storage contains data from v2 if ('version_history' in storage) { - options.blockAds = storage.enable_ad_block || true; - options.blockTrackers = storage.enable_anti_tracking || true; - options.blockAnnoyances = storage.enable_autoconsent || true; + options.blockAds = storage.enable_ad_block ?? true; + options.blockTrackers = storage.enable_anti_tracking ?? true; + options.blockAnnoyances = storage.enable_autoconsent ?? true; options.onboarding = { done: storage.setup_complete || storage.setup_skip || false, @@ -241,12 +241,13 @@ async function migrateFromMV2() { options.terms = storage.setup_complete || false; - options.wtmSerpReport = storage.enable_wtm_serp_report || true; + options.wtmSerpReport = storage.enable_wtm_serp_report ?? true; options.autoconsent = { all: !storage.autoconsent_whitelist, allowed: storage.autoconsent_whitelist || [], disallowed: storage.autoconsent_blacklist || [], + interactions: storage.autoconsent_interactions || 0, }; options.paused = storage.site_whitelist.map((domain) => ({