use longer update interval for web

This commit is contained in:
zadam 2021-02-27 21:08:27 +01:00
parent 3fe87259e2
commit 3c7a6bc1e4
3 changed files with 8 additions and 6 deletions

8
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "trilium", "name": "trilium",
"version": "0.46.1-beta", "version": "0.46.2-beta",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -2712,9 +2712,9 @@
} }
}, },
"electron-dl": { "electron-dl": {
"version": "3.1.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-3.1.0.tgz", "resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-3.2.0.tgz",
"integrity": "sha512-nY3vvxX5w11+cFT6JkJwMHtH6dk5sPtjRtzjaj4NrS9CyYF3atvVt8yMfZtXruULU1JAuxEEf2B8O6YgXs9xsQ==", "integrity": "sha512-Wz6YZi0fwy/hmdkrtrBwj7W4JlrFd1tY5jvNdLHd0PUTlJFJ6pGi9mPQGtZRdjodkXYpaiD1uio+wh01hqrZNg==",
"requires": { "requires": {
"ext-name": "^5.0.0", "ext-name": "^5.0.0",
"pupa": "^2.0.1", "pupa": "^2.0.1",

View file

@ -35,7 +35,7 @@
"dayjs": "1.10.4", "dayjs": "1.10.4",
"ejs": "3.1.6", "ejs": "3.1.6",
"electron-debug": "3.2.0", "electron-debug": "3.2.0",
"electron-dl": "3.1.0", "electron-dl": "3.2.0",
"electron-find": "1.0.6", "electron-find": "1.0.6",
"electron-window-state": "5.0.3", "electron-window-state": "5.0.3",
"express": "4.17.1", "express": "4.17.1",

View file

@ -54,6 +54,8 @@ export default class NoteDetailWidget extends TabAwareWidget {
this.typeWidgets = {}; this.typeWidgets = {};
const updateInterval = utils.isDesktop() ? 1000 : 5000;
this.spacedUpdate = new SpacedUpdate(async () => { this.spacedUpdate = new SpacedUpdate(async () => {
const {note} = this.tabContext; const {note} = this.tabContext;
const {noteId} = note; const {noteId} = note;
@ -64,7 +66,7 @@ export default class NoteDetailWidget extends TabAwareWidget {
protectedSessionHolder.touchProtectedSessionIfNecessary(note); protectedSessionHolder.touchProtectedSessionIfNecessary(note);
await server.put('notes/' + noteId, dto, this.componentId); await server.put('notes/' + noteId, dto, this.componentId);
}); }, updateInterval);
} }
isEnabled() { isEnabled() {