diff options
author | Ms Kimsible <1877318+kimsible@users.noreply.github.com> | 2021-08-26 08:40:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-26 08:40:18 +0200 |
commit | 52a354ab7af7bd29ca0128fa7c501ea08aa5a343 (patch) | |
tree | d0bdd4e4e113d0b82774d6efd236a127b5f9db35 /client/src/app/core | |
parent | 7dca45f99db58d9bb3423a3765aaee68c69bc9f2 (diff) | |
download | PeerTube-52a354ab7af7bd29ca0128fa7c501ea08aa5a343.tar.gz PeerTube-52a354ab7af7bd29ca0128fa7c501ea08aa5a343.tar.zst PeerTube-52a354ab7af7bd29ca0128fa7c501ea08aa5a343.zip |
Fix user quota alerts always displayed (#4354)
* Fix user quota alerts display on upload page
* Fix border-radius upload messages alerts
Co-authored-by: Ms Kimsible <kimsible@users.noreply.github.com>
Diffstat (limited to 'client/src/app/core')
-rw-r--r-- | client/src/app/core/users/user.model.ts | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/client/src/app/core/users/user.model.ts b/client/src/app/core/users/user.model.ts index 5e1fb1c8d..7467519c4 100644 --- a/client/src/app/core/users/user.model.ts +++ b/client/src/app/core/users/user.model.ts | |||
@@ -137,26 +137,4 @@ export class User implements UserServerModel { | |||
137 | isAutoBlocked () { | 137 | isAutoBlocked () { |
138 | return this.role === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST | 138 | return this.role === UserRole.USER && this.adminFlags !== UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST |
139 | } | 139 | } |
140 | |||
141 | hasNoQuotaLeft () { | ||
142 | // unlimited videoQuota | ||
143 | if (this.videoQuota === -1) return false | ||
144 | |||
145 | // no more videoQuota | ||
146 | if (!this.videoQuotaUsed) return true | ||
147 | |||
148 | // videoQuota left lower than 10% | ||
149 | return this.videoQuotaUsed > this.videoQuota * 0.9 | ||
150 | } | ||
151 | |||
152 | hasNoQuotaLeftDaily () { | ||
153 | // unlimited videoQuotaDaily | ||
154 | if (this.videoQuotaDaily === -1) return false | ||
155 | |||
156 | // no more videoQuotaDaily | ||
157 | if (!this.videoQuotaUsedDaily) return true | ||
158 | |||
159 | // videoQuotaDaily left lower than 10% | ||
160 | return this.videoQuotaUsedDaily > this.videoQuotaDaily * 0.9 | ||
161 | } | ||
162 | } | 140 | } |