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])
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 <Runs