chore(client): fix type error after update of knockout

This commit is contained in:
Elian Doran
2026-03-14 11:32:44 +02:00
parent ae38ac4de8
commit 5b16ff8be1

View File

@@ -1,7 +1,9 @@
import "jquery";
import utils from "./services/utils.js";
import ko from "knockout";
import utils from "./services/utils.js";
// TriliumNextTODO: properly make use of below types
// type SetupModelSetupType = "new-document" | "sync-from-desktop" | "sync-from-server" | "";
// type SetupModelStep = "sync-in-progress" | "setup-type" | "new-document-in-progress" | "sync-from-desktop";
@@ -74,9 +76,9 @@ class SetupModel {
// not using server.js because it loads too many dependencies
const resp = await $.post("api/setup/sync-from-server", {
syncServerHost: syncServerHost,
syncProxy: syncProxy,
password: password
syncServerHost,
syncProxy,
password
});
if (resp.result === "success") {
@@ -123,6 +125,8 @@ function getSyncInProgress() {
}
addEventListener("DOMContentLoaded", (event) => {
ko.applyBindings(new SetupModel(getSyncInProgress()), document.getElementById("setup-dialog"));
const rootNode = document.getElementById("setup-dialog");
if (!rootNode) return;
ko.applyBindings(new SetupModel(getSyncInProgress()), rootNode);
$("#setup-dialog").show();
});