From 6d97c2813b13a009adf3cbd978c5144b18e705dd Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 12 Feb 2023 17:58:56 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=90=AF=E5=8A=A8=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=90=8E=E7=AB=8B=E5=8D=B3=E5=90=8C=E6=AD=A5=E5=BA=94=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=98=AF=E5=90=A6=E4=B8=BA=E6=89=8B=E5=8A=A8=E5=90=8C?= =?UTF-8?q?=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/sync/syncGuide.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/sync/syncGuide.ts b/app/src/sync/syncGuide.ts index aa79373ff..564c64f6a 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(); }); } };