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