diff options
Diffstat (limited to 'client/src/app/shared/moderation')
-rw-r--r-- | client/src/app/shared/moderation/user-moderation-dropdown.component.ts | 15 |
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 @@ | |||
1 | import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' | 1 | import { Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core' |
2 | import { I18n } from '@ngx-translate/i18n-polyfill' | 2 | import { I18n } from '@ngx-translate/i18n-polyfill' |
3 | import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' | 3 | import { DropdownAction } from '@app/shared/buttons/action-dropdown.component' |
4 | import { UserBanModalComponent } from '@app/shared/moderation/user-ban-modal.component' | 4 | import { UserBanModalComponent } from '@app/shared/moderation/user-ban-modal.component' |
@@ -7,12 +7,13 @@ import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' | |||
7 | import { User, UserRight } from '../../../../../shared/models/users' | 7 | import { User, UserRight } from '../../../../../shared/models/users' |
8 | import { Account } from '@app/shared/account/account.model' | 8 | import { Account } from '@app/shared/account/account.model' |
9 | import { BlocklistService } from '@app/shared/blocklist' | 9 | import { BlocklistService } from '@app/shared/blocklist' |
10 | import { 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 | }) |
15 | export class UserModerationDropdownComponent implements OnChanges { | 16 | export 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 () { |