mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-09-27 21:56:38 +08:00
debug:mergeAppState list key
This commit is contained in:
parent
bf5546b112
commit
e5edfd97a5
@ -96,7 +96,7 @@ export const useSyncStore = createPersistStore(
|
||||
const config = get()[provider];
|
||||
const client = this.getClient();
|
||||
|
||||
await client.set(config.username, JSON.stringify(localState));
|
||||
|
||||
|
||||
try {
|
||||
const remoteState = await client.get(config.username);
|
||||
@ -116,6 +116,8 @@ export const useSyncStore = createPersistStore(
|
||||
throw e;
|
||||
}
|
||||
|
||||
await client.set(config.username, JSON.stringify(localState));
|
||||
|
||||
|
||||
|
||||
this.markSyncTime();
|
||||
|
@ -137,9 +137,12 @@ export function setLocalAppState(appState: AppState) {
|
||||
export function mergeAppState(localState: AppState, remoteState: AppState) {
|
||||
Object.keys(localState).forEach(<T extends keyof AppState>(k: string) => {
|
||||
const key = k as T;
|
||||
//if(k !== ''){
|
||||
console.log('mergeAppState',k)
|
||||
const localStoreState = localState[key];
|
||||
const remoteStoreState = remoteState[key];
|
||||
MergeStates[key](localStoreState, remoteStoreState);
|
||||
//}
|
||||
});
|
||||
|
||||
return localState;
|
||||
|
Loading…
Reference in New Issue
Block a user