feat:add comments

This commit is contained in:
cbmland 2024-07-14 12:08:06 +08:00
parent da0ff0192d
commit c0c3d7fd34

View File

@ -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);