From 9a690dbcd0e44a66dd4fa37543da82272cbd9053 Mon Sep 17 00:00:00 2001 From: Hk-Gosuto Date: Wed, 13 Sep 2023 13:06:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(15):=20=E4=BF=AE=E5=A4=8D=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=94=AF=E6=8C=81=E6=A8=A1=E5=9E=8B=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/chat.tsx | 25 +++++++++++++------------ app/store/mask.ts | 8 +++++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 36928af9c..c87791109 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -512,17 +512,18 @@ export function ChatActions(props: { icon={} /> - {config.pluginConfig.enable && !/03\d{2}$/.test(currentModel) && ( - : } - /> - )} + {config.pluginConfig.enable && + /^gpt(?!.*03\d{2}$).*$/.test(currentModel) && ( + : } + /> + )} {showModelSelector && ( { 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, ); }); diff --git a/app/store/mask.ts b/app/store/mask.ts index 19509e1b3..9c07d52b4 100644 --- a/app/store/mask.ts +++ b/app/store/mask.ts @@ -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); },