diff --git a/src/pages/MainPage.tsx b/src/pages/MainPage.tsx index 9f2a1187..9b67f629 100644 --- a/src/pages/MainPage.tsx +++ b/src/pages/MainPage.tsx @@ -101,6 +101,17 @@ export const MainPage = ({ handleEditRecording }: MainPageProps) => { } }, [runningRecordingName, sockets, ids, readyForRunHandler, debugMessageHandler]) + const handleScheduleRecording = (settings: ScheduleSettings) => { + scheduleStoredRecording(runningRecordingName, settings) + .then(({message, runId}: ScheduleRunResponse) => { + if (message === 'success') { + notify('success', `Recording ${runningRecordingName} scheduled successfully`); + } else { + notify('error', `Failed to schedule recording ${runningRecordingName}`); + } + }); + } + const DisplayContent = () => { switch (content) { case 'recordings': @@ -108,7 +119,7 @@ export const MainPage = ({ handleEditRecording }: MainPageProps) => { handleEditRecording={handleEditRecording} handleRunRecording={handleRunRecording} setFileName={setFileName} - handleScheduleRecording={(settings: ScheduleSettings) => scheduleStoredRecording(runningRecordingName, settings)} + handleScheduleRecording={handleScheduleRecording} />; case 'runs': return