Fix autoblock message on upload page
This commit is contained in:
parent
ab7b4f525b
commit
e0b1231b20
|
@ -15,7 +15,7 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container *ngIf="!user.isUploadDisabled()">
|
<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>
|
<div>{{ uploadMessages.autoBlock }}</div>
|
||||||
<ng-template [ngTemplateOutlet]="AlertButtons" *ngIf="!hasNoQuotaLeft && !hasNoQuotaLeftDaily"></ng-template>
|
<ng-template [ngTemplateOutlet]="AlertButtons" *ngIf="!hasNoQuotaLeft && !hasNoQuotaLeftDaily"></ng-template>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -43,7 +43,7 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate {
|
||||||
hasNoQuotaLeft = false
|
hasNoQuotaLeft = false
|
||||||
hasNoQuotaLeftDaily = false
|
hasNoQuotaLeftDaily = false
|
||||||
|
|
||||||
private serverConfig: HTMLServerConfig
|
serverConfig: HTMLServerConfig
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private auth: AuthService,
|
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 { hasUserRight } from '@shared/core-utils/users'
|
||||||
import {
|
import {
|
||||||
ActorImage,
|
ActorImage,
|
||||||
|
HTMLServerConfig,
|
||||||
NSFWPolicyType,
|
NSFWPolicyType,
|
||||||
User as UserServerModel,
|
User as UserServerModel,
|
||||||
UserAdminFlag,
|
UserAdminFlag,
|
||||||
|
@ -136,7 +137,9 @@ export class User implements UserServerModel {
|
||||||
return this.videoQuota === 0 || this.videoQuotaDaily === 0
|
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
|
return this.role === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue