mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-16 22:13:47 +08:00
修复模型选择继承的小bug
This commit is contained in:
@@ -224,14 +224,22 @@ export const useChatStore = createPersistStore(
|
||||
});
|
||||
},
|
||||
|
||||
newSession(mask?: Mask, currentModel?: Mask["modelConfig"]["model"]) {
|
||||
newSession(
|
||||
mask?: Mask,
|
||||
currentModel?: Mask["modelConfig"]["model"],
|
||||
currentProviderName?: ServiceProvider,
|
||||
) {
|
||||
const session = createEmptySession();
|
||||
const config = useAppConfig.getState();
|
||||
// console.log("------", session, "2222", config);
|
||||
// 继承当前会话的模型
|
||||
// 继承当前会话的模型,
|
||||
// 新增继承模型提供者
|
||||
if (currentModel) {
|
||||
session.mask.modelConfig.model = currentModel;
|
||||
}
|
||||
if (currentProviderName) {
|
||||
session.mask.modelConfig.providerName = currentProviderName;
|
||||
}
|
||||
if (mask) {
|
||||
const config = useAppConfig.getState();
|
||||
const globalModelConfig = config.modelConfig;
|
||||
|
||||
@@ -140,7 +140,7 @@ export const useAppConfig = createPersistStore(
|
||||
}),
|
||||
{
|
||||
name: StoreKey.Config,
|
||||
version: 3.96,
|
||||
version: 3.97,
|
||||
migrate(persistedState, version) {
|
||||
const state = persistedState as ChatConfig;
|
||||
|
||||
@@ -176,7 +176,7 @@ export const useAppConfig = createPersistStore(
|
||||
// return { ...DEFAULT_CONFIG };
|
||||
// }
|
||||
|
||||
if (version < 3.96) {
|
||||
if (version < 3.97) {
|
||||
state.modelConfig = DEFAULT_CONFIG.modelConfig;
|
||||
// state.modelConfig.template =
|
||||
// state.modelConfig.template !== DEFAULT_INPUT_TEMPLATE
|
||||
|
||||
Reference in New Issue
Block a user