Schedule
-
{formatSchedule(workflow.schedule)}
+ {/* A paused workflow fell through formatSchedule to "Scheduled for 9:00 AM", so this card announced a schedule while the panel beside it said Not scheduled. */}
+
+ {isScheduleActive(workflow.schedule) ? formatSchedule(workflow.schedule) : 'Not scheduled'}
+
{workflow.next_run_at && (
Next run {new Date(workflow.next_run_at).toLocaleString([], { weekday: 'short', month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit' })}
diff --git a/frontend/src/shared/state/workflowsSlice.ts b/frontend/src/shared/state/workflowsSlice.ts
index 445e0250..fd84212c 100644
--- a/frontend/src/shared/state/workflowsSlice.ts
+++ b/frontend/src/shared/state/workflowsSlice.ts
@@ -414,9 +414,12 @@ export const fetchDeletedWorkflows = createAsyncThunk('workflows/fetchDeleted',
return data.workflows as Workflow[];
});
-export const restoreWorkflow = createAsyncThunk('workflows/restore', async (id: string) => {
+export const restoreWorkflow = createAsyncThunk('workflows/restore', async (id: string, { dispatch }) => {
const res = await fetch(`${API}/${id}/restore`, { method: 'POST' });
if (!res.ok) throw new Error(`restore failed ${res.status}`);
+ // Trashing drops the run rows from the store; the server kept them, so pull them back or a restored workflow claims "No runs yet" over a real history.
+ void dispatch(fetchRuns(id));
+ void dispatch(fetchAllRuns(200));
return (await res.json()) as Workflow;
});