Skip to content

Commit 7a3fd88

Browse files
shivamhwpclaude
andcommitted
fix(mobile): keep reset controls when a ChatGPT limit has a reset time
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 8858ce6 commit 7a3fd88

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎apps/mobile/src/features/threads/UsageLimitRecoveryCard.test.tsx‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,21 @@ describe("UsageLimitRecoveryCard", () => {
6666
},
6767
);
6868

69+
it("keeps reset controls for a ChatGPT limit stored with a reset time", () => {
70+
const container = document.createElement("div");
71+
const root = createRoot(container);
72+
using _root = { [Symbol.dispose]: () => act(() => root.unmount()) };
73+
act(() =>
74+
root.render(
75+
<UsageLimitRecoveryCard
76+
thread={failedThread(new Date(DAY_MS).toISOString(), CHATGPT_USAGE_LIMIT_CODE)}
77+
environmentId={"env-1" as EnvironmentId}
78+
/>,
79+
),
80+
);
81+
expect(container.textContent).toContain("Resume at reset");
82+
});
83+
6984
it("disables Snooze once a reset more than 24.8 days away passes", () => {
7085
using _timers = { [Symbol.dispose]: () => vi.useRealTimers() };
7186
vi.useFakeTimers({ now: 0 });

‎apps/mobile/src/features/threads/UsageLimitRecoveryCard.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ export function UsageLimitRecoveryCard({
3939
thread.runtime?.status !== "failed" ||
4040
thread.runtime.lastErrorClass !== "usage_limit" ||
4141
!runId ||
42-
// ChatGptUsageLimitNotice owns these; sharing limits never report a reset time.
43-
code === CHATGPT_USAGE_LIMIT_CODE ||
44-
code === CHATGPT_WORKSPACE_USAGE_LIMIT_CODE
42+
// Without a reset there is nothing to schedule, and ChatGptUsageLimitNotice covers it.
43+
(resetAt === null &&
44+
(code === CHATGPT_USAGE_LIMIT_CODE || code === CHATGPT_WORKSPACE_USAGE_LIMIT_CODE))
4545
)
4646
return null;
4747
const snoozed =

0 commit comments

Comments
 (0)