feat: handleScheduleRecoridng

This commit is contained in:
karishmas6
2024-09-13 15:34:10 +05:30
parent 4991627b9f
commit 8937e9b639

View File

@@ -101,6 +101,17 @@ export const MainPage = ({ handleEditRecording }: MainPageProps) => {
} }
}, [runningRecordingName, sockets, ids, readyForRunHandler, debugMessageHandler]) }, [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 = () => { const DisplayContent = () => {
switch (content) { switch (content) {
case 'recordings': case 'recordings':
@@ -108,7 +119,7 @@ export const MainPage = ({ handleEditRecording }: MainPageProps) => {
handleEditRecording={handleEditRecording} handleEditRecording={handleEditRecording}
handleRunRecording={handleRunRecording} handleRunRecording={handleRunRecording}
setFileName={setFileName} setFileName={setFileName}
handleScheduleRecording={(settings: ScheduleSettings) => scheduleStoredRecording(runningRecordingName, settings)} handleScheduleRecording={handleScheduleRecording}
/>; />;
case 'runs': case 'runs':
return <Runs return <Runs