1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-02-07 19:30:04 +02:00

Merge branch 'master' of github.com:laurent22/joplin

This commit is contained in:
Laurent Cozic 2019-02-02 10:54:07 +00:00
commit a2dbbbf832

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