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

This commit is contained in:
tidusjar 2022-11-21 08:23:05 +00:00
commit 187b18d5c0
2 changed files with 7 additions and 1 deletions

View file

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

View file

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