|
1 | 1 | import { Component, Inject, OnInit } from "@angular/core"; |
2 | 2 | import { FormBuilder, FormGroup } from "@angular/forms"; |
3 | 3 | import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; |
4 | | -import { Observable } from "rxjs"; |
| 4 | +import { firstValueFrom, Observable } from "rxjs"; |
5 | 5 | import { startWith, map } from "rxjs/operators"; |
6 | 6 | import { ILanguageProfiles, IRadarrProfile, IRadarrRootFolder, ISonarrProfile, ISonarrRootFolder, ISonarrSettings, IUserDropdown, RequestType } from "../../interfaces"; |
7 | 7 | import { IdentityService, MessageService, RadarrService, RequestService, SettingsService, SonarrService } from "../../services"; |
@@ -55,7 +55,7 @@ export class AdminRequestDialogComponent implements OnInit { |
55 | 55 | radarrFolderId: [null] |
56 | 56 | }) |
57 | 57 |
|
58 | | - this.options = await this.identityService.getUsersDropdown().toPromise(); |
| 58 | + this.options = await firstValueFrom(this.identityService.getUsersDropdown()); |
59 | 59 |
|
60 | 60 | this.filteredOptions = this.form.controls['username'].valueChanges.pipe( |
61 | 61 | startWith(""), |
@@ -96,7 +96,10 @@ export class AdminRequestDialogComponent implements OnInit { |
96 | 96 | public displayFn(user: IUserDropdown): string { |
97 | 97 | const username = user?.username ? user.username : ""; |
98 | 98 | const email = user?.email ? `(${user.email})` : ""; |
99 | | - return `${username} ${email}`; |
| 99 | + if (username && email) { |
| 100 | + return `${username} ${email}`; |
| 101 | + } |
| 102 | + return ''; |
100 | 103 | } |
101 | 104 |
|
102 | 105 | private _filter(value: string | IUserDropdown): IUserDropdown[] { |
|
0 commit comments