1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Note reloading issue

This commit is contained in:
Laurent Cozic 2019-02-02 10:47:26 +00:00
parent 242926d381
commit 8ced2d288e

View File

@ -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 });
}