diff --git a/libraries/springy.js b/libraries/springy.js index 7767b2eb4..f9bc03ffb 100644 --- a/libraries/springy.js +++ b/libraries/springy.js @@ -486,7 +486,7 @@ window.Springy = function() { t._started = false; onRenderStop(); } else { - requestIdleCallback(step, { timeout: 10 }); + requestIdleCallback(step, { timeout: 30 }); } } diff --git a/src/public/javascripts/services/app_context.js b/src/public/javascripts/services/app_context.js index ebec1a93d..04ba44556 100644 --- a/src/public/javascripts/services/app_context.js +++ b/src/public/javascripts/services/app_context.js @@ -433,22 +433,6 @@ class AppContext { this.openTabsChangedListener(); } - // FIXME non existent event - noteChangesSavedListener() { - const activeTabContext = this.getActiveTabContext(); - - if (!activeTabContext || !activeTabContext.note) { - return; - } - - if (activeTabContext.note.isProtected && protectedSessionHolder.isProtectedSessionAvailable()) { - protectedSessionHolder.touchProtectedSession(); - } - - // run async - bundleService.executeRelationBundles(activeTabContext.note, 'runOnNoteChange', activeTabContext); - } - activateNextTabListener() { const tabIdsInOrder = this.tabRow.getTabIdsInOrder(); const oldIdx = tabIdsInOrder.findIndex(tid => tid === this.activeTabId); diff --git a/src/public/javascripts/services/bundle.js b/src/public/javascripts/services/bundle.js index 95d973085..d85638b5e 100644 --- a/src/public/javascripts/services/bundle.js +++ b/src/public/javascripts/services/bundle.js @@ -29,21 +29,8 @@ async function executeStartupBundles() { } } -async function executeRelationBundles(note, relationName, tabContext) { - note.bundleCache = note.bundleCache || {}; - - if (!note.bundleCache[relationName]) { - note.bundleCache[relationName] = await server.get("script/relation/" + note.noteId + "/" + relationName); - } - - for (const bundle of note.bundleCache[relationName]) { - await executeBundle(bundle, note, tabContext); - } -} - export default { executeBundle, getAndExecuteBundle, - executeStartupBundles, - executeRelationBundles + executeStartupBundles } \ No newline at end of file diff --git a/src/public/javascripts/services/server.js b/src/public/javascripts/services/server.js index 8181ffc88..54e5fb04e 100644 --- a/src/public/javascripts/services/server.js +++ b/src/public/javascripts/services/server.js @@ -50,6 +50,8 @@ let maxKnownSyncId = 0; async function call(method, url, data, headers = {}) { let resp; + const start = Date.now(); + if (utils.isElectron()) { const ipc = require('electron').ipcRenderer; const requestId = i++; @@ -74,6 +76,10 @@ async function call(method, url, data, headers = {}) { resp = await ajax(url, method, data, headers); } + const end = Date.now(); + + console.log(`${method} ${url} took ${end-start}ms`); + const maxSyncIdStr = resp.headers['trilium-max-sync-id']; if (maxSyncIdStr && maxSyncIdStr.trim()) { diff --git a/src/public/javascripts/services/tab_context.js b/src/public/javascripts/services/tab_context.js index dbce42527..d8b11d92f 100644 --- a/src/public/javascripts/services/tab_context.js +++ b/src/public/javascripts/services/tab_context.js @@ -66,9 +66,6 @@ class TabContext extends Component { } }, 5000); - // should be done somewhere else ... - bundleService.executeRelationBundles(this.note, 'runOnNoteView', this); - if (this.note.isProtected && protectedSessionHolder.isProtectedSessionAvailable()) { // FIXME: there are probably more places where this should be done protectedSessionHolder.touchProtectedSession(); diff --git a/src/public/javascripts/widgets/attributes.js b/src/public/javascripts/widgets/attributes.js index 8cacb6a12..f8fbbd574 100644 --- a/src/public/javascripts/widgets/attributes.js +++ b/src/public/javascripts/widgets/attributes.js @@ -24,46 +24,44 @@ export default class AttributesWidget extends CollapsibleWidget { } async refreshWithNote(note) { - const attributes = await note.getAttributes(); const ownedAttributes = note.getOwnedAttributes(); - - if (attributes.length === 0) { - this.$body.text("No attributes yet..."); - return; - } - const $attributesContainer = $("