1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-09-16 08:56:19 +02:00

disable patches on read-only unmount (#4608)

This commit is contained in:
Scott Bishel
2023-03-02 04:09:32 -07:00
committed by GitHub
parent bd7608ff11
commit 805e0d93dc

View File

@@ -35,11 +35,14 @@ const URLProperty = (props: PropertyProps): JSX.Element => {
if (value !== (props.card.fields.properties[props.propertyTemplate?.id || ''] || '')) {
mutator.changePropertyValue(props.board.id, props.card, props.propertyTemplate?.id || '', value)
}
}, [props.card, props.propertyTemplate, value])
}, [props.board.id, props.card, props.propertyTemplate?.id, value])
const saveTextPropertyRef = useRef<() => void>(saveTextProperty)
saveTextPropertyRef.current = saveTextProperty
if (props.readOnly) {
saveTextPropertyRef.current = () => null
} else {
saveTextPropertyRef.current = saveTextProperty
}
useEffect(() => {
return () => {
saveTextPropertyRef.current && saveTextPropertyRef.current()