mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-13 00:36:02 +00:00
fix: app monthly usage details error (#1761)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
This commit is contained in:
@@ -169,16 +169,16 @@ export class MeteringAndBillingService {
|
||||
const appId = actor.type?.app?.uid;
|
||||
if ( appTotals && appId ) {
|
||||
const filteredAppTotals: Record<string, UsageByType> = {};
|
||||
let othersTotal: UsageByType | null = null;
|
||||
let othersTotal: UsageByType = {} as UsageByType;
|
||||
Object.entries(appTotals).forEach(([appKey, appUsage]) => {
|
||||
if ( appKey === appId ) {
|
||||
filteredAppTotals[appKey] = appUsage;
|
||||
} else {
|
||||
Object.entries(appUsage).forEach(([usageKind, amount]) => {
|
||||
if ( !othersTotal![usageKind] ) {
|
||||
othersTotal![usageKind] = 0;
|
||||
if ( !othersTotal[usageKind] ) {
|
||||
othersTotal[usageKind] = 0;
|
||||
}
|
||||
othersTotal![usageKind] += amount;
|
||||
othersTotal[usageKind] += amount;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user