From b31f8dd962658c80eef1b78e08ea0c84c10f645e Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sun, 11 Oct 2020 00:15:06 +0100 Subject: [PATCH] Fixed #3702 --- .../app/usermanagement/usermanagement.component.html | 2 +- .../src/app/usermanagement/usermanagement.component.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) 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.");