mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Electron: Improve speed of loading notes that include many resources, and prevent UI from freezing
This commit is contained in:
parent
70adf10f2e
commit
d27cbaa663
@ -711,8 +711,16 @@ class NoteTextComponent extends React.Component {
|
||||
updateHtml(body = null) {
|
||||
const mdOptions = {
|
||||
onResourceLoaded: () => {
|
||||
this.updateHtml();
|
||||
this.forceUpdate();
|
||||
if (this.resourceLoadedTimeoutId_) {
|
||||
clearTimeout(this.resourceLoadedTimeoutId_);
|
||||
this.resourceLoadedTimeoutId_ = null;
|
||||
}
|
||||
|
||||
this.resourceLoadedTimeoutId_ = setTimeout(() => {
|
||||
this.resourceLoadedTimeoutId_ = null;
|
||||
this.updateHtml();
|
||||
this.forceUpdate();
|
||||
}, 1000);
|
||||
},
|
||||
postMessageSyntax: 'ipcRenderer.sendToHost',
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user