Fix autoblock message on upload page
This commit is contained in:
parent
9da443f374
commit
8e7442d0d8
|
@ -15,7 +15,7 @@
|
|||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="!user.isUploadDisabled()">
|
||||
<div *ngIf="user.isAutoBlocked()" class="upload-message auto-blocked alert alert-warning">
|
||||
<div *ngIf="user.isAutoBlocked(serverConfig)" class="upload-message auto-blocked alert alert-warning">
|
||||
<div>{{ uploadMessages.autoBlock }}</div>
|
||||
<ng-template [ngTemplateOutlet]="AlertButtons" *ngIf="!hasNoQuotaLeft && !hasNoQuotaLeftDaily"></ng-template>
|
||||
</div>
|
||||
|
|
|
@ -43,7 +43,7 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate {
|
|||
hasNoQuotaLeft = false
|
||||
hasNoQuotaLeftDaily = false
|
||||
|
||||
private serverConfig: HTMLServerConfig
|
||||
serverConfig: HTMLServerConfig
|
||||
|
||||
constructor (
|
||||
private auth: AuthService,
|
||||
|
|
|
@ -2,6 +2,7 @@ import { Account } from '@app/shared/shared-main/account/account.model'
|
|||
import { hasUserRight } from '@shared/core-utils/users'
|
||||
import {
|
||||
ActorImage,
|
||||
HTMLServerConfig,
|
||||
NSFWPolicyType,
|
||||
User as UserServerModel,
|
||||
UserAdminFlag,
|
||||
|
@ -136,7 +137,9 @@ export class User implements UserServerModel {
|
|||
return this.videoQuota === 0 || this.videoQuotaDaily === 0
|
||||
}
|
||||
|
||||
isAutoBlocked () {
|
||||
isAutoBlocked (serverConfig: HTMLServerConfig) {
|
||||
if (serverConfig.autoBlacklist.videos.ofUsers.enabled !== true) return false
|
||||
|
||||
return this.role === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue