From fe31f08c0dcb290b796b50c12146258dced06c1a Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 19 Feb 2020 22:09:49 +0100 Subject: [PATCH] show setup window if DB is not initialized --- electron.js | 6 +++--- src/services/sync.js | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/electron.js b/electron.js index 8296d0435..d7f094a17 100644 --- a/electron.js +++ b/electron.js @@ -26,9 +26,9 @@ app.on('ready', async () => { await sqlInit.dbConnection; - // if schema doesn't exist -> setup process - // if schema exists, then we need to wait until the migration process is finished - if (await sqlInit.schemaExists()) { + // if db is not initialized -> setup process + // if db is initialized, then we need to wait until the migration process is finished + if (await sqlInit.isDbInitialized()) { await sqlInit.dbReady; await windowService.createMainWindow(); diff --git a/src/services/sync.js b/src/services/sync.js index 8cb12339c..0d965d88f 100644 --- a/src/services/sync.js +++ b/src/services/sync.js @@ -228,9 +228,10 @@ async function syncFinished(syncContext) { async function checkContentHash(syncContext) { const resp = await syncRequest(syncContext, 'GET', '/api/sync/check'); + const lastSyncedPullId = await getLastSyncedPull(); - if (await getLastSyncedPull() < resp.maxSyncId) { - log.info("There are some outstanding pulls, skipping content check."); + if (lastSyncedPullId < resp.maxSyncId) { + log.info(`There are some outstanding pulls (${lastSyncedPullId} vs. ${resp.maxSyncId}), skipping content check.`); return true; }