mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 02:03:42 +08:00
fix: Hide free quota display for zero quotas
- Remove the quota display for Zero quotas - Parse the `const quotaPerUnit` once
This commit is contained in:
@@ -125,10 +125,6 @@ export function timestamp2string(timestamp) {
|
||||
}
|
||||
|
||||
export function calculateQuota(quota = 0, digits = 2) {
|
||||
if (!quota || quota === 0) {
|
||||
return 'free';
|
||||
}
|
||||
|
||||
let quotaPerUnit = localStorage.getItem('quota_per_unit');
|
||||
quotaPerUnit = parseFloat(quotaPerUnit);
|
||||
|
||||
|
||||
@@ -38,10 +38,6 @@ export function renderNumber(num) {
|
||||
}
|
||||
|
||||
export function renderQuota(quota, digits = 2) {
|
||||
if (quota === 0) {
|
||||
return 'free';
|
||||
}
|
||||
|
||||
let quotaPerUnit = localStorage.getItem('quota_per_unit');
|
||||
let displayInCurrency = localStorage.getItem('display_in_currency');
|
||||
quotaPerUnit = parseFloat(quotaPerUnit);
|
||||
|
||||
Reference in New Issue
Block a user