mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-09-28 14:16:37 +08:00
feat:add comments
This commit is contained in:
parent
da0ff0192d
commit
c0c3d7fd34
@ -92,14 +92,13 @@ export const useSyncStore = createPersistStore(
|
|||||||
},
|
},
|
||||||
|
|
||||||
async sync() {
|
async sync() {
|
||||||
const accessStore = useAccessStore.getState();
|
const accessStore = useAccessStore.getState(); //to keep local access code
|
||||||
const localState = getLocalAppState();
|
const localState = getLocalAppState();
|
||||||
const provider = get().provider;
|
const provider = get().provider;
|
||||||
const config = get()[provider];
|
const config = get()[provider];
|
||||||
const client = this.getClient();
|
const client = this.getClient();
|
||||||
|
|
||||||
//console.log("===== accessStore", accessStore);
|
//console.log("===== accessStore", accessStore);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const remoteState = await client.get(config.username);
|
const remoteState = await client.get(config.username);
|
||||||
if (!remoteState || remoteState === "") {
|
if (!remoteState || remoteState === "") {
|
||||||
@ -111,6 +110,7 @@ export const useSyncStore = createPersistStore(
|
|||||||
} else {
|
} else {
|
||||||
let parsedRemoteState = JSON.parse(await client.get(config.username));
|
let parsedRemoteState = JSON.parse(await client.get(config.username));
|
||||||
parsedRemoteState["access-control"] = accessStore;
|
parsedRemoteState["access-control"] = accessStore;
|
||||||
|
|
||||||
//console.log("parsedRemoteState------", parsedRemoteState);
|
//console.log("parsedRemoteState------", parsedRemoteState);
|
||||||
mergeAppState(localState, parsedRemoteState);
|
mergeAppState(localState, parsedRemoteState);
|
||||||
setLocalAppState(localState);
|
setLocalAppState(localState);
|
||||||
|
Loading…
Reference in New Issue
Block a user