fix(ui): do not display negative remaining quota (#1859)

* fix(ui): do not display negative remaining quota

* fix: correct remaining quota count on API side
This commit is contained in:
TheCatLady
2021-06-30 11:16:40 -04:00
committed by GitHub
parent 11378549c6
commit 3841fb06eb
3 changed files with 16 additions and 24 deletions

View File

@@ -134,13 +134,10 @@ const UserProfile: React.FC = () => {
{quota.movie.limit ? (
<>
<ProgressCircle
progress={Math.max(
0,
Math.round(
((quota?.movie.remaining ?? 0) /
(quota?.movie.limit ?? 1)) *
100
)
progress={Math.round(
((quota?.movie.remaining ?? 0) /
(quota?.movie.limit ?? 1)) *
100
)}
useHeatLevel
className="w-8 h-8 mr-2"
@@ -193,13 +190,10 @@ const UserProfile: React.FC = () => {
{quota.tv.limit ? (
<>
<ProgressCircle
progress={Math.max(
0,
Math.round(
((quota?.tv.remaining ?? 0) /
(quota?.tv.limit ?? 1)) *
100
)
progress={Math.round(
((quota?.tv.remaining ?? 0) /
(quota?.tv.limit ?? 1)) *
100
)}
useHeatLevel
className="w-8 h-8 mr-2"