aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/moderation
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/moderation')
-rw-r--r--client/src/app/shared/moderation/user-moderation-dropdown.component.ts15
1 files changed, 12 insertions, 3 deletions
diff --git a/client/src/app/shared/moderation/user-moderation-dropdown.component.ts b/client/src/app/shared/moderation/user-moderation-dropdown.component.ts
index e9d4c1437..d82dc3d94 100644
--- a/client/src/app/shared/moderation/user-moderation-dropdown.component.ts
+++ b/client/src/app/shared/moderation/user-moderation-dropdown.component.ts
@@ -1,4 +1,4 @@
1import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' 1import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core'
2import { I18n } from '@ngx-translate/i18n-polyfill' 2import { I18n } from '@ngx-translate/i18n-polyfill'
3import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' 3import { DropdownAction } from '@app/shared/buttons/action-dropdown.component'
4import { UserBanModalComponent } from '@app/shared/moderation/user-ban-modal.component' 4import { UserBanModalComponent } from '@app/shared/moderation/user-ban-modal.component'
@@ -7,12 +7,13 @@ import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core'
7import { User, UserRight } from '../../../../../shared/models/users' 7import { User, UserRight } from '../../../../../shared/models/users'
8import { Account } from '@app/shared/account/account.model' 8import { Account } from '@app/shared/account/account.model'
9import { BlocklistService } from '@app/shared/blocklist' 9import { BlocklistService } from '@app/shared/blocklist'
10import { ServerConfig } from '@shared/models'
10 11
11@Component({ 12@Component({
12 selector: 'my-user-moderation-dropdown', 13 selector: 'my-user-moderation-dropdown',
13 templateUrl: './user-moderation-dropdown.component.html' 14 templateUrl: './user-moderation-dropdown.component.html'
14}) 15})
15export class UserModerationDropdownComponent implements OnChanges { 16export class UserModerationDropdownComponent implements OnInit, OnChanges {
16 @ViewChild('userBanModal', { static: false }) userBanModal: UserBanModalComponent 17 @ViewChild('userBanModal', { static: false }) userBanModal: UserBanModalComponent
17 18
18 @Input() user: User 19 @Input() user: User
@@ -26,6 +27,8 @@ export class UserModerationDropdownComponent implements OnChanges {
26 27
27 userActions: DropdownAction<{ user: User, account: Account }>[][] = [] 28 userActions: DropdownAction<{ user: User, account: Account }>[][] = []
28 29
30 private serverConfig: ServerConfig
31
29 constructor ( 32 constructor (
30 private authService: AuthService, 33 private authService: AuthService,
31 private notifier: Notifier, 34 private notifier: Notifier,
@@ -38,7 +41,13 @@ export class UserModerationDropdownComponent implements OnChanges {
38 ) { } 41 ) { }
39 42
40 get requiresEmailVerification () { 43 get requiresEmailVerification () {
41 return this.serverService.getConfig().signup.requiresEmailVerification 44 return this.serverConfig.signup.requiresEmailVerification
45 }
46
47 ngOnInit (): void {
48 this.serverConfig = this.serverService.getTmpConfig()
49 this.serverService.getConfig()
50 .subscribe(config => this.serverConfig = config)
42 } 51 }
43 52
44 ngOnChanges () { 53 ngOnChanges () {