From c8af8746175ad458ecd8fb3957971cc3ce99d6d4 Mon Sep 17 00:00:00 2001 From: o0Sh4d0w0o <25451887+o0sh4d0w0o@users.noreply.github.com> Date: Thu, 19 Sep 2024 10:31:49 +0200 Subject: [PATCH] Fixed captions when storage has been disabled --- src/js/captions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/captions.js b/src/js/captions.js index c22a1ddb0..ab8d62ed5 100644 --- a/src/js/captions.js +++ b/src/js/captions.js @@ -86,14 +86,14 @@ const captions = { const browserLanguages = navigator.languages || [navigator.language || navigator.userLanguage || 'en']; const languages = dedupe(browserLanguages.map((language) => language.split('-')[0])); - let language = (this.storage.get('language') || this.config.captions.language || 'auto').toLowerCase(); + let language = (this.storage.get('language') || this.captions.language || this.config.captions.language || 'auto').toLowerCase(); // Use first browser language when language is 'auto' if (language === 'auto') { [language] = languages; } - let active = this.storage.get('captions'); + let active = this.storage.get('captions') || this.captions.active; if (!is.boolean(active)) { ({ active } = this.config.captions); }