mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-24 14:40:22 +09:00
fix(15): 修复插件功能支持模型判断逻辑
This commit is contained in:
parent
38c41f9ed3
commit
9a690dbcd0
@ -512,7 +512,8 @@ export function ChatActions(props: {
|
||||
icon={<RobotIcon />}
|
||||
/>
|
||||
|
||||
{config.pluginConfig.enable && !/03\d{2}$/.test(currentModel) && (
|
||||
{config.pluginConfig.enable &&
|
||||
/^gpt(?!.*03\d{2}$).*$/.test(currentModel) && (
|
||||
<ChatAction
|
||||
onClick={switchUsePlugins}
|
||||
text={
|
||||
@ -537,7 +538,7 @@ export function ChatActions(props: {
|
||||
chatStore.updateCurrentSession((session) => {
|
||||
session.mask.modelConfig.model = s[0] as ModelType;
|
||||
session.mask.syncGlobalConfig = false;
|
||||
session.mask.usePlugins = !/03\d{2}$/.test(
|
||||
session.mask.usePlugins = /^gpt(?!.*03\d{2}$).*$/.test(
|
||||
session.mask.modelConfig.model,
|
||||
);
|
||||
});
|
||||
|
@ -38,8 +38,10 @@ export const createEmptyMask = () =>
|
||||
lang: getLang(),
|
||||
builtin: false,
|
||||
createdAt: Date.now(),
|
||||
usePlugins: !/03\d{2}$/.test(useAppConfig.getState().modelConfig.model),
|
||||
} as Mask);
|
||||
usePlugins: /^gpt(?!.*03\d{2}$).*$/.test(
|
||||
useAppConfig.getState().modelConfig.model,
|
||||
),
|
||||
}) as Mask;
|
||||
|
||||
export const useMaskStore = createPersistStore(
|
||||
{ ...DEFAULT_MASK_STATE },
|
||||
@ -94,7 +96,7 @@ export const useMaskStore = createPersistStore(
|
||||
...config.modelConfig,
|
||||
...m.modelConfig,
|
||||
},
|
||||
} as Mask),
|
||||
}) as Mask,
|
||||
);
|
||||
return userMasks.concat(buildinMasks);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user