fixed:recovery disable

This commit is contained in:
cbmland 2024-07-13 20:28:10 +08:00
parent c621662aae
commit da0ff0192d
4 changed files with 4 additions and 7 deletions

View File

@ -19,7 +19,7 @@ export function AuthPage() {
const resetAccessCode = () => {
accessStore.update((access) => {
access.openaiApiKey = "";
//access.accessCode = "";
access.accessCode = "";
});
}; // Reset access code to empty string

View File

@ -105,7 +105,7 @@ export const useAppConfig = createPersistStore(
{ ...DEFAULT_CONFIG },
(set, get) => ({
reset() {
//set(() => ({ ...DEFAULT_CONFIG }));
set(() => ({ ...DEFAULT_CONFIG }));
},
mergeModels(newModels: LLMModel[]) {

View File

@ -98,7 +98,7 @@ export const useSyncStore = createPersistStore(
const config = get()[provider];
const client = this.getClient();
console.log("===== accessStore", accessStore);
//console.log("===== accessStore", accessStore);
try {
const remoteState = await client.get(config.username);
@ -111,7 +111,7 @@ export const useSyncStore = createPersistStore(
} else {
let parsedRemoteState = JSON.parse(await client.get(config.username));
parsedRemoteState["access-control"] = accessStore;
console.log("parsedRemoteState------", parsedRemoteState);
//console.log("parsedRemoteState------", parsedRemoteState);
mergeAppState(localState, parsedRemoteState);
setLocalAppState(localState);
}

View File

@ -137,12 +137,9 @@ 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;