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:
Proddy
2024-07-06 19:27:46 +02:00
committed by GitHub
2 changed files with 77 additions and 77 deletions

View File

@@ -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());
});
};

View File

@@ -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 && (