diff --git a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.html b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.html
index 60ecb6438..92a98cc76 100644
--- a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.html
+++ b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.html
@@ -8,7 +8,7 @@
-
+
diff --git a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts
index f3a910b1a..8ab01f665 100644
--- a/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts
+++ b/src/Ombi/ClientApp/src/app/usermanagement/usermanagement.component.ts
@@ -1,4 +1,4 @@
-import { Component, OnInit, ViewChild } from "@angular/core";
+import { AfterViewInit, Component, OnInit, ViewChild } from "@angular/core";
import { ICheckbox, ICustomizationSettings, IEmailNotificationSettings, IUser } from "../interfaces";
import { IdentityService, NotificationService, SettingsService } from "../services";
@@ -10,7 +10,7 @@ import { SelectionModel } from "@angular/cdk/collections";
templateUrl: "./usermanagement.component.html",
styleUrls: ["./usermanagement.component.scss"],
})
-export class UserManagementComponent implements OnInit {
+export class UserManagementComponent implements OnInit, AfterViewInit {
public displayedColumns: string[] = ['select', 'username', 'alias', 'email', 'roles', 'remainingRequests',
'nextRequestDue', 'lastLoggedIn', 'userType', 'actions', 'welcome'];
@@ -33,11 +33,11 @@ export class UserManagementComponent implements OnInit {
private notificationService: NotificationService,
private plexSettings: SettingsService) { }
+
public async ngOnInit() {
this.users = await this.identityService.getUsers().toPromise();
this.dataSource = new MatTableDataSource(this.users);
- this.dataSource.sort = this.sort;
this.plexSettings.getPlex().subscribe(x => this.plexEnabled = x.enable);
@@ -46,6 +46,10 @@ export class UserManagementComponent implements OnInit {
this.settingsService.getEmailNotificationSettings().subscribe(x => this.emailSettings = x);
}
+ public ngAfterViewInit(): void {
+ this.dataSource.sort = this.sort;
+ }
+
public welcomeEmail(user: IUser) {
if (!user.emailAddress) {
this.notificationService.error("The user needs an email address.");
|