mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
Merge pull request #1851 from proddy/dev
small change to make sure flags are set in Scheduler with a Timer
This commit is contained in:
@@ -169,12 +169,8 @@ const UploadDownload: FC = () => {
|
||||
};
|
||||
|
||||
const downloadSchedule = async () => {
|
||||
await getSchedule()
|
||||
.catch((error: Error) => {
|
||||
await getSchedule().catch((error: Error) => {
|
||||
toast.error(error.message);
|
||||
})
|
||||
.finally(() => {
|
||||
toast.info(LL.DOWNLOAD_SUCCESSFUL());
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ const SchedulerDialog = ({
|
||||
</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
<Box display="flex" flexWrap="wrap" mb={1}>
|
||||
<Box flexGrow={1}>
|
||||
<Box>
|
||||
<ToggleButtonGroup
|
||||
size="small"
|
||||
color="secondary"
|
||||
@@ -191,7 +191,7 @@ const SchedulerDialog = ({
|
||||
</ToggleButton>
|
||||
</ToggleButtonGroup>
|
||||
</Box>
|
||||
<Box flexWrap="nowrap" whiteSpace="nowrap">
|
||||
<Box sx={{ '& button, & a, & .MuiCard-root': { ml: 1 } }}>
|
||||
{isTimer ? (
|
||||
<Button
|
||||
size="large"
|
||||
@@ -217,8 +217,6 @@ const SchedulerDialog = ({
|
||||
{showFlag(editItem, ScheduleFlag.SCHEDULE_TIMER)}
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
<Box>
|
||||
{isOnChange ? (
|
||||
<Button
|
||||
size="large"
|
||||
@@ -247,8 +245,6 @@ const SchedulerDialog = ({
|
||||
{showFlag(editItem, ScheduleFlag.SCHEDULE_ONCHANGE)}
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
<Box>
|
||||
{isCondition ? (
|
||||
<Button
|
||||
size="large"
|
||||
@@ -279,6 +275,8 @@ const SchedulerDialog = ({
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
{editItem.flags !== 0 && (
|
||||
<>
|
||||
<Grid container>
|
||||
<BlockFormControlLabel
|
||||
control={
|
||||
@@ -297,7 +295,9 @@ const SchedulerDialog = ({
|
||||
name="time"
|
||||
label={isCondition ? 'Condition' : 'On Change Value'}
|
||||
fullWidth
|
||||
value={editItem.time == '00:00' ? (editItem.time = '') : editItem.time}
|
||||
value={
|
||||
editItem.time == '00:00' ? (editItem.time = '') : editItem.time
|
||||
}
|
||||
margin="normal"
|
||||
onChange={updateFormValue}
|
||||
/>
|
||||
@@ -315,7 +315,9 @@ const SchedulerDialog = ({
|
||||
/>
|
||||
{isTimer && (
|
||||
<Box color="warning.main" ml={2} mt={4}>
|
||||
<Typography variant="body2">{LL.SCHEDULER_HELP_2()}</Typography>
|
||||
<Typography variant="body2">
|
||||
{LL.SCHEDULER_HELP_2()}
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
@@ -348,6 +350,8 @@ const SchedulerDialog = ({
|
||||
margin="normal"
|
||||
onChange={updateFormValue}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
{!creating && (
|
||||
|
||||
Reference in New Issue
Block a user