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

Merge pull request #2497 from daiyam/delete-tag

delete tag through context menu
This commit is contained in:
Junyoung Choi (Sai)
2018-10-23 18:30:20 +09:00
committed by GitHub
5 changed files with 66 additions and 4 deletions

View File

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