Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 启动同步后立即同步应判断是否为手动同步

Vanessa6d97c2813b13
diff --git a/app/src/sync/syncGuide.ts b/app/src/sync/syncGuide.ts
index aa79373ff5..564c64f6a1 100644
--- a/app/src/sync/syncGuide.ts
+++ b/app/src/sync/syncGuide.ts
@@ -137,6 +137,10 @@ export const syncGuide = (element?: Element) => {
setSync();
return;
}
+ syncNow();
+};
+
+const syncNow = () => {
if (window.siyuan.config.sync.mode !== 3) {
fetchPost("/api/sync/performSync", {});
return;
@@ -180,7 +184,7 @@ export const syncGuide = (element?: Element) => {
fetchPost("/api/sync/performSync", {upload: uploadElement.value === "true"});
manualDialog.destroy();
});
-};
+}
const setSync = (key?: string, dialog?: Dialog) => {
if (key) {
@@ -222,7 +226,7 @@ const setSync = (key?: string, dialog?: Dialog) => {
window.siyuan.config.sync.enabled = true;
processSync();
confirmDialog(window.siyuan.languages.syncConfGuide4, window.siyuan.languages.syncConfGuide5, () => {
- fetchPost("/api/sync/performSync", {});
+ syncNow();
});
});
});
@@ -231,7 +235,7 @@ const setSync = (key?: string, dialog?: Dialog) => {
dialog.destroy();
}
confirmDialog(window.siyuan.languages.syncConfGuide4, window.siyuan.languages.syncConfGuide5, () => {
- fetchPost("/api/sync/performSync", {});
+ syncNow();
});
}
};