Skip to content

Commit 2d059ce

Browse files
tan7virclaude
andcommitted
fix(usage): keep the hub merge call site unchanged to shrink the diff
Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent 8a3e8f3 commit 2d059ce

1 file changed

Lines changed: 23 additions & 24 deletions

File tree

‎packages/shared/src/usageLimits.ts‎

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -312,31 +312,30 @@ export function collectLimitAccounts(
312312
: source.label;
313313
for (const account of source.accounts) {
314314
if (limitsNotice(account.usageLimits) !== null) continue;
315-
merge(
315+
const key =
316316
accountGroupKey(account.driver, account.email, account.plan, knownPlans) ??
317-
`${source.id}:${account.id}`,
318-
{
319-
key: `${source.id}:${account.id}`,
320-
driver: account.driver,
321-
displayName: account.email ? null : account.id.replace(/\.json$/i, ""),
322-
email: account.email,
323-
plan: account.plan,
324-
accentColor: undefined,
325-
environments: [],
326-
sourceLabel,
327-
redeem: account.usageLimits.resetCredits?.nextCreditId
328-
? {
329-
environmentId,
330-
input: {
331-
sourceId: source.id,
332-
accountId: account.id,
333-
creditId: account.usageLimits.resetCredits.nextCreditId,
334-
},
335-
}
336-
: null,
337-
limits: account.usageLimits,
338-
},
339-
);
317+
`${source.id}:${account.id}`;
318+
merge(key, {
319+
key: `${source.id}:${account.id}`,
320+
driver: account.driver,
321+
displayName: account.email ? null : account.id.replace(/\.json$/i, ""),
322+
email: account.email,
323+
plan: account.plan,
324+
accentColor: undefined,
325+
environments: [],
326+
sourceLabel,
327+
redeem: account.usageLimits.resetCredits?.nextCreditId
328+
? {
329+
environmentId,
330+
input: {
331+
sourceId: source.id,
332+
accountId: account.id,
333+
creditId: account.usageLimits.resetCredits.nextCreditId,
334+
},
335+
}
336+
: null,
337+
limits: account.usageLimits,
338+
});
340339
}
341340
}
342341
}

0 commit comments

Comments
 (0)