@devries-cameron20 / t3code Mirror · read-only / commits / b5df3c1bef
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 14:45 UTC

fix(web): a scheduled task with a cleared run time no longer saves as 09:00 (#36789)

Co-authored-by: Alex Southwell <4596216+saphid@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

Julius Marminge committed Nov 14, 2026 at 07:23 UTC b5df3c1bef533530a8491d06c2d95ecceb2f0748
2 files changed +13 -1
apps/web/src/components/settings/scheduledTasksSettings.logic.test.ts
+10
@@ -181,6 +181,16 @@ describe("fixed-time scheduled tasks", () => {
181 });
182 expect(draft.timeOfDay).toBe("09:05");
183 });
184 +
185 + it("keeps a fixed run time and rejects a cleared one", () => {
186 + const draft = taskToDraft({
187 + ...legacyTask,
188 + schedule: { type: "fixed_time", timeOfDay: "14:30" },
189 + });
190 + expect(scheduleFromDraft(draft)).toEqual({ type: "fixed_time", timeOfDay: "14:30" });
191 + // A native time input reports "" when it is cleared or only partly filled.
192 + expect(scheduleFromDraft({ ...draft, timeOfDay: "" })).toBeNull();
193 + });
194 });
195
196 describe("scheduled task destination", () => {
apps/web/src/components/settings/scheduledTasksSettings.logic.ts
+3 -1
@@ -156,6 +156,8 @@ export function scheduleDraftErrors(draft: DraftState) {
156 ];
157 return [];
158 }
159 + if (draft.scheduleMode === "fixed" && !draft.timeOfDay)
160 + return [{ title: "Invalid run time", description: "Pick a time." }];
161 if (draft.scheduleMode !== "webhook") return [];
162 if (parseMaxDeliveryAge(draft.maxDeliveryAgeMinutes) === undefined)
163 return [
@@ -266,7 +268,7 @@ export function scheduleFromDraft(draft: DraftState): ScheduledTaskUpsertSchedul
268 const selectedEveryDay = draft.weekdays.size === 0 || draft.weekdays.size === 7;
269 return {
270 type: "fixed_time",
269 - timeOfDay: draft.timeOfDay || "09:00",
271 + timeOfDay: draft.timeOfDay,
272 ...(selectedEveryDay ? {} : { weekdays: [...draft.weekdays].toSorted() }),
273 };
274 }