mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-24 08:12:24 +02:00
Improved loading of notes
This commit is contained in:
parent
aefeca66d5
commit
269a77e5f3
@ -138,8 +138,6 @@ class AppGui {
|
||||
}
|
||||
});
|
||||
this.rootWidget_.connect(folderList, (state) => {
|
||||
this.logger().info('Updating folder list...');
|
||||
|
||||
return {
|
||||
selectedFolderId: state.selectedFolderId,
|
||||
selectedTagId: state.selectedTagId,
|
||||
|
@ -14,20 +14,17 @@ class NoteWidget extends TextWidget {
|
||||
}
|
||||
|
||||
set noteId(v) {
|
||||
// If this is called it means either the note ID has changed OR
|
||||
// the note content has changed, so we always set note_ to null
|
||||
// so that it can be reloaded in onWillRender().
|
||||
this.noteId_ = v;
|
||||
this.note_ = null;
|
||||
this.invalidate();
|
||||
}
|
||||
|
||||
async onWillRender() {
|
||||
if (!this.note_ && this.noteId_) {
|
||||
this.note_ = await Note.load(this.noteId_);
|
||||
if (this.noteId_) {
|
||||
this.doAsync('loadNote', async () => {
|
||||
this.note_ = await Note.load(this.noteId_);
|
||||
this.text = this.note_ ? this.note_.title + "\n\n" + this.note_.body : '';
|
||||
});
|
||||
} else {
|
||||
this.text = '';
|
||||
}
|
||||
|
||||
this.text = this.note_ ? this.note_.title + "\n\n" + this.note_.body : '';
|
||||
}
|
||||
|
||||
}
|
||||
|
6
CliClient/package-lock.json
generated
6
CliClient/package-lock.json
generated
@ -5771,9 +5771,9 @@
|
||||
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
|
||||
},
|
||||
"tkwidgets": {
|
||||
"version": "0.5.16",
|
||||
"resolved": "https://registry.npmjs.org/tkwidgets/-/tkwidgets-0.5.16.tgz",
|
||||
"integrity": "sha512-rXZF92F90FjXggpnag4XADzZvHfsfiRNERQ8jAPM17qCVeZX93Tv7MgYZRNSWS+cwYRhKsY0vpHbnhVcxucjmw==",
|
||||
"version": "0.5.17",
|
||||
"resolved": "https://registry.npmjs.org/tkwidgets/-/tkwidgets-0.5.17.tgz",
|
||||
"integrity": "sha512-joIO431vWD058OUxsQH+IwMcyPtemNafwWw6hkBnLLZ/8YI1Fc6BMuRP1oEInfW1ZhlpFPQiKqrU2DY/2v9l+g==",
|
||||
"requires": {
|
||||
"chalk": "2.3.0",
|
||||
"node-emoji": "git+https://github.com/laurent22/node-emoji.git#9fa01eac463e94dde1316ef8c53089eeef4973b5",
|
||||
|
@ -55,7 +55,7 @@
|
||||
"string-to-stream": "^1.1.0",
|
||||
"strip-ansi": "^4.0.0",
|
||||
"tcp-port-used": "^0.1.2",
|
||||
"tkwidgets": "^0.5.16",
|
||||
"tkwidgets": "^0.5.17",
|
||||
"uuid": "^3.0.1",
|
||||
"word-wrap": "^1.2.3",
|
||||
"yargs-parser": "^7.0.0"
|
||||
|
@ -13,6 +13,7 @@
|
||||
"locales/*.json",
|
||||
"ReactNativeClient/locales/*",
|
||||
"src/log.txt",
|
||||
"log.txt",
|
||||
],
|
||||
"folder_exclude_patterns":
|
||||
[
|
||||
|
3
package-lock.json
generated
Normal file
3
package-lock.json
generated
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"lockfileVersion": 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user