fix(settings): 🐛 Fixed the issue where you couldn't save the Plex settings

pull/4340/head
tidusjar 3 years ago
parent 1ef45dc44c
commit 89a856a5d2

@ -14,6 +14,7 @@
"conventionalCommits.scopes": [ "conventionalCommits.scopes": [
"discover", "discover",
"request-limits", "request-limits",
"notifications" "notifications",
"settings"
] ]
} }

@ -63,6 +63,7 @@ export class PlexComponent implements OnInit, OnDestroy {
server.plexAuthToken = selectedServer.accessToken; server.plexAuthToken = selectedServer.accessToken;
server.port = parseInt(selectedServer.port); server.port = parseInt(selectedServer.port);
server.ssl = selectedServer.scheme === "http" ? false : true; server.ssl = selectedServer.scheme === "http" ? false : true;
server.serverHostname = "";
this.notificationService.success(`Selected ${server.name}!`); this.notificationService.success(`Selected ${server.name}!`);
} }
@ -128,7 +129,7 @@ export class PlexComponent implements OnInit, OnDestroy {
let invalid = false; let invalid = false;
this.settings.servers.forEach(server => { this.settings.servers.forEach(server => {
if (server.serverHostname.length > 0 && !server.serverHostname.startsWith("http")) { if (server.serverHostname && server.serverHostname.length > 0 && !server.serverHostname.startsWith("http")) {
invalid = true; invalid = true;
} }
}); });

Loading…
Cancel
Save