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

This commit is contained in:
Vanessa 2023-02-12 17:58:56 +08:00
parent 79b87b25ad
commit 6d97c2813b

View File

@ -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();
});
}
};