From 612445b4fae90922536ed7acc48e86e85e47b0f9 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Sun, 21 Jan 2024 22:34:28 +0700 Subject: [PATCH] fix: loader bar selected model right panel --- web/containers/DropdownListSidebar/index.tsx | 148 ++++++++++--------- web/containers/OpenAiKeyInput/index.tsx | 1 + 2 files changed, 76 insertions(+), 73 deletions(-) diff --git a/web/containers/DropdownListSidebar/index.tsx b/web/containers/DropdownListSidebar/index.tsx index fd0223bdb..a4b5746d7 100644 --- a/web/containers/DropdownListSidebar/index.tsx +++ b/web/containers/DropdownListSidebar/index.tsx @@ -158,85 +158,87 @@ export default function DropdownListSidebar() { } return ( -
- + + + {stateModel.loading && ( +
)} - > - {selectedName} - - - - - -
- - Local -
-
- {downloadedModels.length === 0 ? ( -
-

{`Oops, you don't have a model yet.`}

-
- ) : ( - - {downloadedModels.map((x, i) => ( - -
- {x.name} -
- - {toGibibytes(x.metadata.size)} - - {x.engine == InferenceEngine.nitro && ( - - )} -
-
-
- ))} -
- )} -
-
- -
- - - + {selectedName} + + + + + +
+ + Local +
+
+ {downloadedModels.length === 0 ? ( +
+

{`Oops, you don't have a model yet.`}

+
+ ) : ( + + {downloadedModels.map((x, i) => ( + +
+ {x.name} +
+ + {toGibibytes(x.metadata.size)} + + {x.engine == InferenceEngine.nitro && ( + + )} +
+
+
+ ))} +
+ )} +
+
+ +
+ + + +
-
+ ) } diff --git a/web/containers/OpenAiKeyInput/index.tsx b/web/containers/OpenAiKeyInput/index.tsx index 154745d3e..abd79e6a8 100644 --- a/web/containers/OpenAiKeyInput/index.tsx +++ b/web/containers/OpenAiKeyInput/index.tsx @@ -20,6 +20,7 @@ const OpenAiKeyInput: React.FC = ({ selectedModel, serverEnabled }) => { readOpenAISettings().then((settings) => { setOpenAISettings(settings) }) + // eslint-disable-next-line react-hooks/exhaustive-deps }, []) if (!selectedModel || selectedModel.engine !== InferenceEngine.openai) {