mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-25 17:09:09 +00:00
refract: cleanup undefined state
This commit is contained in:
@@ -17,7 +17,7 @@ export default function TimeInput(props) {
|
|||||||
const [value, setValue] = useState(props.value);
|
const [value, setValue] = useState(props.value);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (props.value === null) return;
|
if (props.value == null) return;
|
||||||
setValue(props.value);
|
setValue(props.value);
|
||||||
}, [props.value]);
|
}, [props.value]);
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,11 @@ export default function DelayBlock(props) {
|
|||||||
eventsHandler('delete', data.id);
|
eventsHandler('delete', data.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let delayValue = (data.duration != null) ? millisToMinutes(data.duration) : undefined;
|
||||||
return (
|
return (
|
||||||
<div className={style.delay}>
|
<div className={style.delay}>
|
||||||
<TimeInput
|
<TimeInput
|
||||||
value={millisToMinutes(data.duration)}
|
value={delayValue}
|
||||||
submitHandler={submitHandler}
|
submitHandler={submitHandler}
|
||||||
/>
|
/>
|
||||||
<div className={style.actionOverlay}>
|
<div className={style.actionOverlay}>
|
||||||
|
|||||||
Reference in New Issue
Block a user