fix: do not show dollar balance if not enabled

This commit is contained in:
JustSong committed 2023-06-21 15:45:30 +08:00
1 parent cded36439e
commit 17bd2d0c5b
3 files changed
+14 -5

No files matched your search

+9
View File
@@ -46,4 +46,13 @@ export function renderQuota(quota, digits = 2) {
return '$' + (quota / quotaPerUnit).toFixed(digits);
}
return renderNumber(quota);
}
export function renderQuotaWithPrompt(quota, digits) {
let displayInCurrency = localStorage.getItem('display_in_currency');
displayInCurrency = displayInCurrency === 'true';
if (displayInCurrency) {
return `(等价金额:${renderQuota(quota, digits)})`;
}
return '';
}