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 = () => { const resetAccessCode = () => {
accessStore.update((access) => { accessStore.update((access) => {
access.openaiApiKey = ""; access.openaiApiKey = "";
//access.accessCode = ""; access.accessCode = "";
}); });
}; // Reset access code to empty string }; // Reset access code to empty string

View File

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

View File

@ -98,7 +98,7 @@ export const useSyncStore = createPersistStore(
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);
@ -111,7 +111,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);
} }

View File

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