This commit is contained in:
Jamie 2017-10-31 10:13:26 +00:00
commit 4fd0125849

View file

@ -30,7 +30,6 @@ export class SonarrComponent implements OnInit {
private fb: FormBuilder) { } private fb: FormBuilder) { }
public ngOnInit() { public ngOnInit() {
this.settingsService.getSonarr() this.settingsService.getSonarr()
.subscribe(x => { .subscribe(x => {
this.form = this.fb.group({ this.form = this.fb.group({
@ -103,10 +102,17 @@ export class SonarrComponent implements OnInit {
this.notificationService.error("Please check your entered values"); this.notificationService.error("Please check your entered values");
return; return;
} }
if(form.controls.defaultQualityProfile.value === "-1" || form.controls.defaultRootPath.value === "Please Select") { if(form.controls.defaultQualityProfile) {
this.notificationService.error("Please check your entered values"); if(form.controls.defaultQualityProfile.value === "-1") {
return; this.notificationService.error("Please check your entered values");
}
} }
if(form.controls.defaultRootPath) {
if(form.controls.defaultRootPath.value === "Please Select") {
this.notificationService.error("Please check your entered values");
}
}
this.settingsService.saveSonarr(form.value) this.settingsService.saveSonarr(form.value)
.subscribe(x => { .subscribe(x => {
if (x) { if (x) {