fix(ai): normalize Z.AI weekly quota window
This commit is contained in:
@@ -158,9 +158,9 @@ function buildZaiWindow(parsed: ZaiUsageLimitItem): UsageWindow {
|
||||
durationMs = count * MONTH_MS;
|
||||
break;
|
||||
case 6:
|
||||
id = `${count}w`;
|
||||
label = count === 1 ? "Weekly" : formatCountedUnit(count, "Week");
|
||||
durationMs = count * WEEK_MS;
|
||||
id = "1w";
|
||||
label = "Weekly";
|
||||
durationMs = WEEK_MS;
|
||||
break;
|
||||
default:
|
||||
id = parsed.unit !== undefined ? `${count}u${parsed.unit}` : "quota";
|
||||
|
||||
@@ -51,7 +51,7 @@ describe("zai usage provider", () => {
|
||||
],
|
||||
},
|
||||
{ type: "TOKENS_LIMIT", percentage: 82, nextResetTime: 1782656863894, unit: 3, number: 5 },
|
||||
{ type: "TOKENS_LIMIT", percentage: 38, nextResetTime: 1783165208993, unit: 6, number: 1 },
|
||||
{ type: "TOKENS_LIMIT", percentage: 38, nextResetTime: 1783165208993, unit: 6, number: 7 },
|
||||
],
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user