mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-16 05:53:42 +08:00
run cloud sync on startup
This commit is contained in:
@@ -27,18 +27,22 @@ const DEFAULT_SYNC_STATE = {
|
||||
useProxy: true,
|
||||
proxyUrl: ApiPath.Cors as string,
|
||||
|
||||
webdav: {
|
||||
[ProviderType.WebDAV]: {
|
||||
endpoint: "",
|
||||
username: "",
|
||||
password: "",
|
||||
},
|
||||
|
||||
upstash: {
|
||||
[ProviderType.UpStash]: {
|
||||
endpoint: "",
|
||||
username: STORAGE_KEY,
|
||||
apiKey: "",
|
||||
},
|
||||
|
||||
autoSync: {
|
||||
onStart: true,
|
||||
},
|
||||
|
||||
lastSyncTime: 0,
|
||||
lastProvider: "",
|
||||
};
|
||||
@@ -46,7 +50,7 @@ const DEFAULT_SYNC_STATE = {
|
||||
export const useSyncStore = createPersistStore(
|
||||
DEFAULT_SYNC_STATE,
|
||||
(set, get) => ({
|
||||
cloudSync() {
|
||||
cloudSync(): boolean {
|
||||
const config = get()[get().provider];
|
||||
return Object.values(config).every((c) => c.toString().length > 0);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user