only save date to database when closing form

This commit is contained in:
Scott Bishel 2023-01-30 17:35:42 -07:00
parent 345ff01539
commit eb8145f18e

View file

@ -61,7 +61,6 @@ function DateRange(props: PropertyProps): JSX.Element {
const onChange = useCallback((newValue) => {
if (value !== newValue) {
setValue(newValue)
mutator.changePropertyValue(board.id, card, propertyTemplate.id, newValue)
}
}, [value, board.id, card, propertyTemplate.id])
@ -150,7 +149,9 @@ function DateRange(props: PropertyProps): JSX.Element {
}
const onClose = () => {
onChange(datePropertyToString(dateProperty))
const newDate = datePropertyToString(dateProperty)
onChange(newDate)
mutator.changePropertyValue(board.id, card, propertyTemplate.id, newDate)
setShowDialog(false)
}