diff --git a/ElectronClient/app/gui/NoteText.jsx b/ElectronClient/app/gui/NoteText.jsx index f36218a66b..aea610ba2f 100644 --- a/ElectronClient/app/gui/NoteText.jsx +++ b/ElectronClient/app/gui/NoteText.jsx @@ -409,7 +409,7 @@ class NoteTextComponent extends React.Component { this.scheduleReloadNoteIID_ = setTimeout(() => { this.reloadNote(props, options); - }, 100); + }, 10); } // Generally, reloadNote() should not be called directly so that it's not called multiple times @@ -562,9 +562,9 @@ class NoteTextComponent extends React.Component { } async componentWillReceiveProps(nextProps) { - if (nextProps.newNote) { + if (this.props.newNote !== nextProps.newNote && nextProps.newNote) { await this.scheduleReloadNote(nextProps); - } else if ('noteId' in nextProps && nextProps.noteId !== this.props.noteId) { + } else if (('noteId' in nextProps) && nextProps.noteId !== this.props.noteId) { await this.scheduleReloadNote(nextProps); } else if ('noteTags' in nextProps && this.areNoteTagsModified(nextProps.noteTags, this.state.noteTags)) { this.setState({ @@ -572,7 +572,7 @@ class NoteTextComponent extends React.Component { }); } - if ('syncStarted' in nextProps && !nextProps.syncStarted && !this.isModified()) { + if ((nextProps.syncStarted !== this.props.syncStarted) && ('syncStarted' in nextProps) && !nextProps.syncStarted && !this.isModified()) { await this.scheduleReloadNote(nextProps, { noReloadIfLocalChanges: true }); }