Skip to content

Commit

Permalink
feat: hide billing progress when pay as you go when over limit
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Jul 31, 2023
1 parent bf6504c commit 71b5c65
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions webapp/src/component/billing/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@ export const getProgressData = (usage: UsageModel): ProgressData => {
? 0
: creditProgressWithExtraUnnormalized;

// const biggerProgress = Math.max(translationsProgress, creditProgress);

const moreCriticalProgress = Math.max(
translationsProgress,
creditProgressExtra
);
const limit = isPayAsYouGo ? 1 : BILLING_CRITICAL_FRACTION;

const isCritical = Number(moreCriticalProgress) > limit;
const isCritical =
!isPayAsYouGo && Number(moreCriticalProgress) > BILLING_CRITICAL_FRACTION;

return {
usesSlots,
Expand Down

0 comments on commit 71b5c65

Please sign in to comment.