mirror of
https://github.com/zadam/trilium.git
synced 2025-02-19 04:22:59 +08:00
show setup window if DB is not initialized
This commit is contained in:
parent
ad7a55d305
commit
fe31f08c0d
2 changed files with 6 additions and 5 deletions
|
@ -26,9 +26,9 @@ app.on('ready', async () => {
|
||||||
|
|
||||||
await sqlInit.dbConnection;
|
await sqlInit.dbConnection;
|
||||||
|
|
||||||
// if schema doesn't exist -> setup process
|
// if db is not initialized -> setup process
|
||||||
// if schema exists, then we need to wait until the migration process is finished
|
// if db is initialized, then we need to wait until the migration process is finished
|
||||||
if (await sqlInit.schemaExists()) {
|
if (await sqlInit.isDbInitialized()) {
|
||||||
await sqlInit.dbReady;
|
await sqlInit.dbReady;
|
||||||
|
|
||||||
await windowService.createMainWindow();
|
await windowService.createMainWindow();
|
||||||
|
|
|
@ -228,9 +228,10 @@ async function syncFinished(syncContext) {
|
||||||
|
|
||||||
async function checkContentHash(syncContext) {
|
async function checkContentHash(syncContext) {
|
||||||
const resp = await syncRequest(syncContext, 'GET', '/api/sync/check');
|
const resp = await syncRequest(syncContext, 'GET', '/api/sync/check');
|
||||||
|
const lastSyncedPullId = await getLastSyncedPull();
|
||||||
|
|
||||||
if (await getLastSyncedPull() < resp.maxSyncId) {
|
if (lastSyncedPullId < resp.maxSyncId) {
|
||||||
log.info("There are some outstanding pulls, skipping content check.");
|
log.info(`There are some outstanding pulls (${lastSyncedPullId} vs. ${resp.maxSyncId}), skipping content check.`);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue