fix: migrate modelConfig state

This commit is contained in:
PaRaD1SE98 2023-06-22 02:11:07 +09:00 committed by GitHub
parent 57447c24c8
commit f4c99c9cf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,14 +176,15 @@ export const useAppConfig = create<ChatConfigStore>()(
}),
{
name: StoreKey.Config,
version: 2,
version: 3,
migrate(persistedState, version) {
if (version === 2) return persistedState as any;
if (version === 3) return persistedState as any;
const state = persistedState as ChatConfig;
state.modelConfig.sendMemory = true;
state.modelConfig.historyMessageCount = 4;
state.modelConfig.compressMessageLengthThreshold = 1000;
state.modelConfig.frequency_penalty = 0;
state.dontShowMaskSplashScreen = false;
return state;