diff --git a/app/components/home.tsx b/app/components/home.tsx index 54cb1ea05..ae7bf901c 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -236,7 +236,7 @@ export function Home() { let running = true; setTimeout(async () => { - if (running && syncStore.cloudSync()) { + if (running && syncStore.cloudSync() && syncStore.autoSync.onStart) { try { await syncStore.sync(); showToast(Locale.Settings.Sync.Success); diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 82ce70e5a..4eff5d789 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -475,6 +475,21 @@ function SyncConfigModal(props: { onClose?: () => void }) { )} + + + + { + syncStore.update( + (config) => + (config.autoSync.onStart = e.currentTarget.checked), + ); + }} + /> + + ); diff --git a/app/locales/cn.ts b/app/locales/cn.ts index e514eb4fe..ea545918d 100644 --- a/app/locales/cn.ts +++ b/app/locales/cn.ts @@ -254,6 +254,10 @@ const cn = { UserName: "备份名称", Password: "UpStash Redis REST Token", }, + + AutoSync: { + OnStartup: "启动时自动同步", + }, }, LocalState: "本地数据", diff --git a/app/locales/en.ts b/app/locales/en.ts index c86cc08f0..fada08193 100644 --- a/app/locales/en.ts +++ b/app/locales/en.ts @@ -257,6 +257,10 @@ const en: LocaleType = { UserName: "Backup Name", Password: "UpStash Redis REST Token", }, + + AutoSync: { + OnStartup: "Sync on startup", + }, }, LocalState: "Local Data", diff --git a/app/store/sync.ts b/app/store/sync.ts index bbde212c0..4db38f40d 100644 --- a/app/store/sync.ts +++ b/app/store/sync.ts @@ -40,7 +40,7 @@ const DEFAULT_SYNC_STATE = { }, autoSync: { - onStart: true, + onStart: false, }, lastSyncTime: 0,