fixed waitForSync

This commit is contained in:
zadam
2020-03-09 22:32:26 +01:00
parent 1d78432df4
commit bcbf1b79c3
4 changed files with 21 additions and 16 deletions

View File

@@ -44,7 +44,7 @@ const auth = require('../services/auth');
const cls = require('../services/cls');
const sql = require('../services/sql');
const protectedSessionService = require('../services/protected_session');
const syncService = require('../services/sync');
const syncTableService = require('../services/sync_table');
const csurf = require('csurf');
const csrfMiddleware = csurf({
@@ -53,7 +53,7 @@ const csrfMiddleware = csurf({
});
function apiResultHandler(req, res, result) {
res.setHeader('trilium-max-sync-id', syncService.getMaxSyncId());
res.setHeader('trilium-max-sync-id', syncTableService.getMaxSyncId());
// if it's an array and first element is integer then we consider this to be [statusCode, response] format
if (Array.isArray(result) && result.length > 0 && Number.isInteger(result[0])) {