feat: update schedule on success
This commit is contained in:
@@ -10,7 +10,7 @@ import { getSchedule, deleteSchedule } from '../../api/storage';
|
|||||||
|
|
||||||
interface ScheduleSettingsProps {
|
interface ScheduleSettingsProps {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
handleStart: (settings: ScheduleSettings) => void;
|
handleStart: (settings: ScheduleSettings) => Promise<boolean>;
|
||||||
handleClose: () => void;
|
handleClose: () => void;
|
||||||
initialSettings?: ScheduleSettings | null;
|
initialSettings?: ScheduleSettings | null;
|
||||||
}
|
}
|
||||||
@@ -272,7 +272,12 @@ export const ScheduleSettingsModal = ({ isOpen, handleStart, handleClose, initia
|
|||||||
</Dropdown>
|
</Dropdown>
|
||||||
</Box>
|
</Box>
|
||||||
<Box mt={2} display="flex" justifyContent="flex-end">
|
<Box mt={2} display="flex" justifyContent="flex-end">
|
||||||
<Button onClick={() => handleStart(settings)} variant="contained" color="primary">
|
<Button onClick={async () => {
|
||||||
|
const success = await handleStart(settings);
|
||||||
|
if (success) {
|
||||||
|
await getRobotSchedule();
|
||||||
|
}
|
||||||
|
}} variant="contained" color="primary">
|
||||||
{t('schedule_settings.buttons.save_schedule')}
|
{t('schedule_settings.buttons.save_schedule')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user