fix(plex): 🐛 Fixed the issue where you couldn't add a new server on a fresh setup after the settings page rework

pull/4810/head
tidusjar 2 years ago
parent 41f0b61518
commit 187b18d5c0

@ -17,7 +17,6 @@ import { PlexServerDialogData } from "../models";
}) })
export class PlexServerDialogComponent { export class PlexServerDialogComponent {
public password: string; public password: string;
public username: string; public username: string;

@ -36,6 +36,10 @@ export class PlexComponent implements OnInit, OnDestroy {
public ngOnInit() { public ngOnInit() {
this.settingsService.getPlex().subscribe(x => { this.settingsService.getPlex().subscribe(x => {
this.settings = x; this.settings = x;
if (!this.settings.servers) {
this.settings.servers = [];
}
}); });
} }
@ -154,6 +158,9 @@ export class PlexComponent implements OnInit, OnDestroy {
panelClass: "modal-panel", panelClass: "modal-panel",
}); });
dialog.afterClosed().subscribe((x) => { dialog.afterClosed().subscribe((x) => {
if (x.closed) {
return;
}
if (x.server) { if (x.server) {
this.settings.servers.push(x.server); this.settings.servers.push(x.server);
} }

Loading…
Cancel
Save