add setting UI

This commit is contained in:
Wang Guan
2024-10-19 19:31:18 +09:00
parent 93ad218d68
commit df7edbd7d0
5 changed files with 25 additions and 2 deletions

View File

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

View File

@@ -475,6 +475,21 @@ function SyncConfigModal(props: { onClose?: () => void }) {
</ListItem>
</List>
)}
<List>
<ListItem title={Locale.Settings.Sync.Config.AutoSync.OnStartup}>
<input
type="checkbox"
checked={syncStore.autoSync.onStart}
onChange={(e) => {
syncStore.update(
(config) =>
(config.autoSync.onStart = e.currentTarget.checked),
);
}}
/>
</ListItem>
</List>
</Modal>
</div>
);