mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-01 07:36:39 +08:00
add setting UI
This commit is contained in:
parent
93ad218d68
commit
df7edbd7d0
@ -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);
|
||||
|
@ -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>
|
||||
);
|
||||
|
@ -254,6 +254,10 @@ const cn = {
|
||||
UserName: "备份名称",
|
||||
Password: "UpStash Redis REST Token",
|
||||
},
|
||||
|
||||
AutoSync: {
|
||||
OnStartup: "启动时自动同步",
|
||||
},
|
||||
},
|
||||
|
||||
LocalState: "本地数据",
|
||||
|
@ -257,6 +257,10 @@ const en: LocaleType = {
|
||||
UserName: "Backup Name",
|
||||
Password: "UpStash Redis REST Token",
|
||||
},
|
||||
|
||||
AutoSync: {
|
||||
OnStartup: "Sync on startup",
|
||||
},
|
||||
},
|
||||
|
||||
LocalState: "Local Data",
|
||||
|
@ -40,7 +40,7 @@ const DEFAULT_SYNC_STATE = {
|
||||
},
|
||||
|
||||
autoSync: {
|
||||
onStart: true,
|
||||
onStart: false,
|
||||
},
|
||||
|
||||
lastSyncTime: 0,
|
||||
|
Loading…
Reference in New Issue
Block a user