mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-10-04 10:49:18 +08:00
chore: fix usage display
This commit is contained in:
@@ -88,7 +88,11 @@ export async function requestUsage() {
|
|||||||
const response = (await res.json()) as {
|
const response = (await res.json()) as {
|
||||||
total_usage: number;
|
total_usage: number;
|
||||||
};
|
};
|
||||||
return Math.round(response.total_usage) / 100;
|
|
||||||
|
if (response.total_usage) {
|
||||||
|
response.total_usage = Math.round(response.total_usage) / 100;
|
||||||
|
}
|
||||||
|
return response.total_usage;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[Request usage] ", error, res.body);
|
console.error("[Request usage] ", error, res.body);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user