1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

avoid rerendering TagSelect when adding a tag

This commit is contained in:
Baptiste Augrain
2018-10-15 15:29:24 +02:00
parent 4a167aa3d7
commit d8d5810d7c

View File

@@ -65,7 +65,7 @@ class MarkdownNoteDetail extends React.Component {
} }
componentWillReceiveProps (nextProps) { componentWillReceiveProps (nextProps) {
if (!this.state.isMovingNote && (nextProps.note.key !== this.props.note.key || nextProps.note.tags.length !== this.props.note.tags.length)) { if (!this.state.isMovingNote && (nextProps.note.key !== this.props.note.key || nextProps.note.tags.length < this.props.note.tags.length)) {
if (this.saveQueue != null) this.saveNow() if (this.saveQueue != null) this.saveNow()
this.setState({ this.setState({
note: Object.assign({}, nextProps.note) note: Object.assign({}, nextProps.note)