Fix bug on save on unmount (#811)
* Fix tiny code order problem * Fixed #809
This commit is contained in:
parent
b0cf6d0d2f
commit
2f827ba5b4
1 changed files with 3 additions and 3 deletions
|
@ -48,9 +48,11 @@ const PropertyValueElement = (props:Props): JSX.Element => {
|
|||
const finalDisplayValue = displayValue || emptyDisplayValue
|
||||
const [open, setOpen] = useState(false)
|
||||
|
||||
const editableFields: Array<PropertyType> = ['text', 'number', 'email', 'url', 'phone']
|
||||
|
||||
const saveTextProperty = useCallback(() => {
|
||||
if (editableFields.includes(props.propertyTemplate.type)) {
|
||||
if (value !== props.card.fields.properties[props.propertyTemplate.id] || '') {
|
||||
if (value !== (props.card.fields.properties[props.propertyTemplate.id] || '')) {
|
||||
mutator.changePropertyValue(card, propertyTemplate.id, value)
|
||||
}
|
||||
}
|
||||
|
@ -232,8 +234,6 @@ const PropertyValueElement = (props:Props): JSX.Element => {
|
|||
)
|
||||
}
|
||||
|
||||
const editableFields: Array<PropertyType> = ['text', 'number', 'email', 'url', 'phone']
|
||||
|
||||
if (
|
||||
editableFields.includes(propertyTemplate.type)
|
||||
) {
|
||||
|
|
Loading…
Reference in a new issue