From 1300945b75a197bb687888747d60cddaa68ecc5b Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Sat, 12 Oct 2024 19:28:08 +0530 Subject: [PATCH] Fix: Prevent model selection modal from appearing for LM Studio provider When using the LM Studio provider, the model selection modal was incorrectly appearing. This commit prevents the modal from appearing when the provider is set to LM Studio. This ensures that the user experience is consistent across all providers. --- src/components/Option/Settings/openai.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/Option/Settings/openai.tsx b/src/components/Option/Settings/openai.tsx index 07a6132..d0a889c 100644 --- a/src/components/Option/Settings/openai.tsx +++ b/src/components/Option/Settings/openai.tsx @@ -35,8 +35,11 @@ export const OpenAIApp = () => { }) setOpen(false) message.success(t("addSuccess")) - setOpenaiId(data) - setOpenModelModal(true) + if (provider !== "lmstudio") { + setOpenaiId(data) + setOpenModelModal(true) + } + setProvider("custom") } }) @@ -75,8 +78,6 @@ export const OpenAIApp = () => { provider }) } - - setProvider("custom") } const handleEdit = (record: any) => {