mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Fix handling of unset preferences
This commit is contained in:
parent
45a1e4981e
commit
f03e323f90
2 changed files with 3 additions and 3 deletions
|
@ -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 =
|
||||
|
|
|
@ -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",
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue