mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 01:36:24 +01:00
#98, new option "initialized" which indicates if setup has been finished
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import utils from "./services/utils.js";
|
||||
|
||||
function SetupModel() {
|
||||
this.step = ko.observable("setup-type");
|
||||
if (syncInProgress) {
|
||||
setInterval(checkOutstandingSyncs, 1000);
|
||||
}
|
||||
|
||||
this.step = ko.observable(syncInProgress ? "sync-in-progress" : "setup-type");
|
||||
this.setupType = ko.observable();
|
||||
|
||||
this.setupNewDocument = ko.observable(false);
|
||||
@@ -93,8 +97,6 @@ function SetupModel() {
|
||||
if (resp.result === 'success') {
|
||||
this.step('sync-in-progress');
|
||||
|
||||
checkOutstandingSyncs();
|
||||
|
||||
setInterval(checkOutstandingSyncs, 1000);
|
||||
}
|
||||
else {
|
||||
@@ -105,7 +107,12 @@ function SetupModel() {
|
||||
}
|
||||
|
||||
async function checkOutstandingSyncs() {
|
||||
const stats = await $.get('/api/sync/stats');
|
||||
const { stats, initialized } = await $.get('/api/sync/stats');
|
||||
|
||||
if (initialized) {
|
||||
window.location.replace("/");
|
||||
}
|
||||
|
||||
const totalOutstandingSyncs = stats.outstandingPushes + stats.outstandingPulls;
|
||||
|
||||
$("#outstanding-syncs").html(totalOutstandingSyncs);
|
||||
|
||||
Reference in New Issue
Block a user