fix(settings): init settings issue

This commit is contained in:
4gray committed 2023-11-22 21:44:23 +01:00
1 parent 68f07347c6
commit 6ad1aab104
1 file changed
+15 -17
+15 -17
View File
@@ -128,23 +128,21 @@ export class SettingsComponent implements OnInit {
.getValueFromLocalStorage(STORE_KEY.Settings)
.subscribe((settings: Settings) => {
if (settings) {
this.settingsForm.setValue({
player: settings.player
? settings.player
: VideoPlayer.VideoJs,
...(this.isElectron ? { epgUrl: [] } : {}),
language: settings.language
? settings.language
: Language.ENGLISH,
showCaptions: settings.showCaptions
? settings.showCaptions
: false,
theme: settings.theme
? settings.theme
: Theme.LightTheme,
mpvPlayerPath: settings.mpvPlayerPath,
vlcPlayerPath: settings.vlcPlayerPath,
});
try {
this.settingsForm.setValue({
player: settings.player
? settings.player
: VideoPlayer.VideoJs,
...(this.isElectron ? { epgUrl: [] } : {}),
language: settings.language ?? Language.ENGLISH,
showCaptions: settings.showCaptions ?? false,
theme: settings.theme ?? Theme.LightTheme,
mpvPlayerPath: settings.mpvPlayerPath ?? '',
vlcPlayerPath: settings.vlcPlayerPath ?? '',
});
} catch (error) {
throw new Error(error);
}
if (this.isElectron) {
this.setEpgUrls(settings.epgUrl);