diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-08 11:26:17 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-10-08 11:26:17 +0200 |
commit | 8e7442d0d818ef25240b46dd1115187c7c042a3a (patch) | |
tree | 7697e9a48b0dfc5ddeaa0a9010a00b07b01d78b2 /client | |
parent | 9da443f374d9f845331435ce3423ad16e5ac331d (diff) | |
download | PeerTube-8e7442d0d818ef25240b46dd1115187c7c042a3a.tar.gz PeerTube-8e7442d0d818ef25240b46dd1115187c7c042a3a.tar.zst PeerTube-8e7442d0d818ef25240b46dd1115187c7c042a3a.zip |
Fix autoblock message on upload page
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/+videos/+video-edit/video-add.component.html | 2 | ||||
-rw-r--r-- | client/src/app/+videos/+video-edit/video-add.component.ts | 2 | ||||
-rw-r--r-- | client/src/app/core/users/user.model.ts | 5 |
3 files changed, 6 insertions, 3 deletions
diff --git a/client/src/app/+videos/+video-edit/video-add.component.html b/client/src/app/+videos/+video-edit/video-add.component.html index 7dd9ba357..29cf08e75 100644 --- a/client/src/app/+videos/+video-edit/video-add.component.html +++ b/client/src/app/+videos/+video-edit/video-add.component.html | |||
@@ -15,7 +15,7 @@ | |||
15 | </ng-container> | 15 | </ng-container> |
16 | 16 | ||
17 | <ng-container *ngIf="!user.isUploadDisabled()"> | 17 | <ng-container *ngIf="!user.isUploadDisabled()"> |
18 | <div *ngIf="user.isAutoBlocked()" class="upload-message auto-blocked alert alert-warning"> | 18 | <div *ngIf="user.isAutoBlocked(serverConfig)" class="upload-message auto-blocked alert alert-warning"> |
19 | <div>{{ uploadMessages.autoBlock }}</div> | 19 | <div>{{ uploadMessages.autoBlock }}</div> |
20 | <ng-template [ngTemplateOutlet]="AlertButtons" *ngIf="!hasNoQuotaLeft && !hasNoQuotaLeftDaily"></ng-template> | 20 | <ng-template [ngTemplateOutlet]="AlertButtons" *ngIf="!hasNoQuotaLeft && !hasNoQuotaLeftDaily"></ng-template> |
21 | </div> | 21 | </div> |
diff --git a/client/src/app/+videos/+video-edit/video-add.component.ts b/client/src/app/+videos/+video-edit/video-add.component.ts index 46881be4e..bcb2fc4fa 100644 --- a/client/src/app/+videos/+video-edit/video-add.component.ts +++ b/client/src/app/+videos/+video-edit/video-add.component.ts | |||
@@ -43,7 +43,7 @@ export class VideoAddComponent implements OnInit, CanComponentDeactivate { | |||
43 | hasNoQuotaLeft = false | 43 | hasNoQuotaLeft = false |
44 | hasNoQuotaLeftDaily = false | 44 | hasNoQuotaLeftDaily = false |
45 | 45 | ||
46 | private serverConfig: HTMLServerConfig | 46 | serverConfig: HTMLServerConfig |
47 | 47 | ||
48 | constructor ( | 48 | constructor ( |
49 | private auth: AuthService, | 49 | private auth: AuthService, |
diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts index 00078af5d..c0e5d3169 100644 --- a/client/src/app/core/users/user.model.ts +++ b/client/src/app/core/users/user.model.ts | |||
@@ -2,6 +2,7 @@ import { Account } from '@app/shared/shared-main/account/account.model' | |||
2 | import { hasUserRight } from '@shared/core-utils/users' | 2 | import { hasUserRight } from '@shared/core-utils/users' |
3 | import { | 3 | import { |
4 | ActorImage, | 4 | ActorImage, |
5 | HTMLServerConfig, | ||
5 | NSFWPolicyType, | 6 | NSFWPolicyType, |
6 | User as UserServerModel, | 7 | User as UserServerModel, |
7 | UserAdminFlag, | 8 | UserAdminFlag, |
@@ -136,7 +137,9 @@ export class User implements UserServerModel { | |||
136 | return this.videoQuota === 0 || this.videoQuotaDaily === 0 | 137 | return this.videoQuota === 0 || this.videoQuotaDaily === 0 |
137 | } | 138 | } |
138 | 139 | ||
139 | isAutoBlocked () { | 140 | isAutoBlocked (serverConfig: HTMLServerConfig) { |
141 | if (serverConfig.autoBlacklist.videos.ofUsers.enabled !== true) return false | ||
142 | |||
140 | return this.role === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST | 143 | return this.role === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST |
141 | } | 144 | } |
142 | } | 145 | } |