1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

Optimised saving notes

This commit is contained in:
Laurent Cozic
2017-07-16 00:09:04 +01:00
parent 4152fcec5e
commit 12c163ef73
3 changed files with 6 additions and 16 deletions

View File

@ -227,17 +227,12 @@ class Note extends BaseItem {
if (isNew && !o.source) o.source = Setting.value('appName');
if (isNew && !o.source_application) o.source_application = Setting.value('appId');
//return super.save(o, options);
return super.save(o, options).then((result) => {
// 'result' could be a partial one at this point (if, for example, only one property of it was saved)
// so call this.preview() so that the right fields are populated.
return this.load(result.id);
}).then((note) => {
return super.save(o, options).then((note) => {
this.dispatch({
type: 'NOTES_UPDATE_ONE',
note: note,
});
return note;
});
}