Use getPreference* instead of accessing localStorage directly

This commit is contained in:
novenary
2023-02-02 15:25:45 +02:00
parent d980edd843
commit 7b832a981c
4 changed files with 17 additions and 9 deletions

View File

@@ -371,9 +371,8 @@ export default {
"selectedSkip",
"sponsor,interaction,selfpromo,music_offtopic",
).split(",");
const skipOptionsJSON = localStorage.getItem("skipOptions");
if (skipOptionsJSON !== null) {
const skipOptions = JSON.parse(skipOptionsJSON);
const skipOptions = this.getPreferenceJSON("skipOptions");
if (skipOptions !== null) {
selectedSkip = Object.keys(skipOptions).filter(
k => skipOptions[k] !== undefined && skipOptions[k] !== "no",
);