From f03e323f9063538dd9573d774bdbf7e2ff63bac7 Mon Sep 17 00:00:00 2001 From: novenary Date: Mon, 6 Feb 2023 19:18:04 +0200 Subject: [PATCH] Fix handling of unset preferences --- src/components/PreferencesPage.vue | 4 ++-- src/components/WatchVideo.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/PreferencesPage.vue b/src/components/PreferencesPage.vue index b62172be..a97b6107 100644 --- a/src/components/PreferencesPage.vue +++ b/src/components/PreferencesPage.vue @@ -503,7 +503,7 @@ export default { this.sponsorBlock = this.getPreferenceBoolean("sponsorblock", true); var skipOptions, skipList; - if ((skipOptions = this.getPreferenceJSON("skipOptions")) !== null) { + if ((skipOptions = this.getPreferenceJSON("skipOptions")) !== undefined) { if (skipOptions.sponsor !== undefined) this.skipSponsor = skipOptions.sponsor; if (skipOptions.intro !== undefined) this.skipIntro = skipOptions.intro; if (skipOptions.outro !== undefined) this.skipOutro = skipOptions.outro; @@ -513,7 +513,7 @@ export default { if (skipOptions.music_offtopic !== undefined) this.skipMusicOffTopic = skipOptions.music_offtopic; if (skipOptions.poi_highlight !== undefined) this.skipHighlight = skipOptions.poi_highlight; if (skipOptions.filler !== undefined) this.skipFiller = skipOptions.filler; - } else if ((skipList = this.getPreferenceString("selectedSkip")) !== null) { + } else if ((skipList = this.getPreferenceString("selectedSkip")) !== undefined) { skipList = skipList.split(","); this.skipSponsor = this.skipIntro = diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index 24b4302f..7b57b39b 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -372,7 +372,7 @@ export default { "sponsor,interaction,selfpromo,music_offtopic", ).split(","); const skipOptions = this.getPreferenceJSON("skipOptions"); - if (skipOptions !== null) { + if (skipOptions !== undefined) { selectedSkip = Object.keys(skipOptions).filter( k => skipOptions[k] !== undefined && skipOptions[k] !== "no", );