feat: add async schedule recording
This commit is contained in:
@@ -235,15 +235,14 @@ export const MainPage = ({ handleEditRecording, initialContent }: MainPageProps)
|
|||||||
}
|
}
|
||||||
}, [runningRecordingName, sockets, ids, debugMessageHandler, user?.id, t, notify, setRerenderRuns, setQueuedRuns, navigate, setContent, setIds]);
|
}, [runningRecordingName, sockets, ids, debugMessageHandler, user?.id, t, notify, setRerenderRuns, setQueuedRuns, navigate, setContent, setIds]);
|
||||||
|
|
||||||
const handleScheduleRecording = (settings: ScheduleSettings) => {
|
const handleScheduleRecording = async (settings: ScheduleSettings) => {
|
||||||
scheduleStoredRecording(runningRecordingId, settings)
|
const { message, runId }: ScheduleRunResponse = await scheduleStoredRecording(runningRecordingId, settings);
|
||||||
.then(({ message, runId }: ScheduleRunResponse) => {
|
if (message === 'success') {
|
||||||
if (message === 'success') {
|
notify('success', t('main_page.notifications.schedule_success', { name: runningRecordingName }));
|
||||||
notify('success', t('main_page.notifications.schedule_success', { name: runningRecordingName }));
|
} else {
|
||||||
} else {
|
notify('error', t('main_page.notifications.schedule_failed', { name: runningRecordingName }));
|
||||||
notify('error', t('main_page.notifications.schedule_failed', { name: runningRecordingName }));
|
}
|
||||||
}
|
return message === 'success';
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DisplayContent = () => {
|
const DisplayContent = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user