Skip to content

Commit

Permalink
Rename and change logic canUpload to isUploadDisabled
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsible committed Jul 24, 2020
1 parent 1e3267e commit 0c999ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions client/src/app/+videos/+video-edit/video-add.component.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div *ngIf="!user.canUpload()" class="no-upload">
<div *ngIf="user.isUploadDisabled()" class="no-upload">
<div class="alert alert-warning">
<div i18n>Sorry, the upload feature is disabled for your account. If you want to add videos, an admin must unlock your quota.</div>
<a i18n routerLink="/about/instance" class="about-link">Read instance rules for help</a>
</div>
<img src="/client/assets/images/mascot/defeated.svg" alt="defeated mascot">
</div>

<div *ngIf="user.canUpload()" class="margin-content">
<div *ngIf="!user.isUploadDisabled()" class="margin-content">
<div class="alert alert-warning" *ngIf="isRootUser()" i18n>
We recommend you to not use the <strong>root</strong> user to publish your videos, since it's the super-admin account of your instance.
<br />
Expand Down
8 changes: 3 additions & 5 deletions client/src/app/core/users/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,12 @@ export class User implements UserServerModel {
this.account.updateAvatar(newAccountAvatar)
}

canUpload (): boolean {
if (this.videoQuota === 0 || this.videoQuotaDaily === 0) return false

return true
isUploadDisabled (): boolean {
return (this.videoQuota === 0 || this.videoQuotaDaily === 0)
}

canSeeVideosLink (): boolean {
if (this.canUpload()) {
if (!this.isUploadDisabled()) {
return true
}

Expand Down

0 comments on commit 0c999ef

Please sign in to comment.