From 8ced2d288ee58264d0788dbe2b7e24a681f16ea0 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 2 Feb 2019 10:47:26 +0000 Subject: [PATCH] Desktop: Note reloading issue --- ElectronClient/app/gui/NoteText.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ElectronClient/app/gui/NoteText.jsx b/ElectronClient/app/gui/NoteText.jsx index f36218a66..aea610ba2 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 }); }