You've already forked focalboard
mirror of
https://github.com/mattermost/focalboard.git
synced 2025-07-12 23:50:27 +02:00
Fix bug on save on unmount (#811)
* Fix tiny code order problem * Fixed #809
This commit is contained in:
@ -48,9 +48,11 @@ const PropertyValueElement = (props:Props): JSX.Element => {
|
|||||||
const finalDisplayValue = displayValue || emptyDisplayValue
|
const finalDisplayValue = displayValue || emptyDisplayValue
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
|
|
||||||
|
const editableFields: Array<PropertyType> = ['text', 'number', 'email', 'url', 'phone']
|
||||||
|
|
||||||
const saveTextProperty = useCallback(() => {
|
const saveTextProperty = useCallback(() => {
|
||||||
if (editableFields.includes(props.propertyTemplate.type)) {
|
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)
|
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 (
|
if (
|
||||||
editableFields.includes(propertyTemplate.type)
|
editableFields.includes(propertyTemplate.type)
|
||||||
) {
|
) {
|
||||||
|
Reference in New Issue
Block a user