various widget optimizations for faster note switching

This commit is contained in:
zadam
2020-02-03 21:16:33 +01:00
parent 66204811cf
commit 44ddcdd852
13 changed files with 111 additions and 96 deletions

View File

@@ -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()) {