refract: cleanup undefined state

This commit is contained in:
cv
2021-04-24 21:43:29 +02:00
parent a77afa54cf
commit 757ff018c7
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ export default function TimeInput(props) {
const [value, setValue] = useState(props.value);
useEffect(() => {
if (props.value === null) return;
if (props.value == null) return;
setValue(props.value);
}, [props.value]);
@@ -20,10 +20,11 @@ export default function DelayBlock(props) {
eventsHandler('delete', data.id);
};
let delayValue = (data.duration != null) ? millisToMinutes(data.duration) : undefined;
return (
<div className={style.delay}>
<TimeInput
value={millisToMinutes(data.duration)}
value={delayValue}
submitHandler={submitHandler}
/>
<div className={style.actionOverlay}>