From 30065e2f43090f2d3ea53b1c23eb4be58abd171d Mon Sep 17 00:00:00 2001 From: Fee He <602527818@qq.com> Date: Tue, 8 Jul 2025 09:27:34 +0800 Subject: [PATCH] Fix: EsLint Problem of index.tsx (#8710) 'handleOk' was used before it was defined.eslint@typescript-eslint/no-use-before-define ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- .../setting-model/ollama-modal/index.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/web/src/pages/user-setting/setting-model/ollama-modal/index.tsx b/web/src/pages/user-setting/setting-model/ollama-modal/index.tsx index 5b69f9396..9b8b33870 100644 --- a/web/src/pages/user-setting/setting-model/ollama-modal/index.tsx +++ b/web/src/pages/user-setting/setting-model/ollama-modal/index.tsx @@ -50,12 +50,6 @@ const OllamaModal = ({ const { t } = useTranslate('setting'); - const handleKeyDown = async (e: React.KeyboardEvent) => { - if (e.key === 'Enter') { - await handleOk(); - } - }; - const handleOk = async () => { const values = await form.validateFields(); const modelType = @@ -73,6 +67,13 @@ const OllamaModal = ({ onOk?.(data); }; + + const handleKeyDown = async (e: React.KeyboardEvent) => { + if (e.key === 'Enter') { + await handleOk(); + } + }; + const url = llmFactoryToUrlMap[llmFactory as LlmFactory] || 'https://github.com/infiniflow/ragflow/blob/main/docs/guides/models/deploy_local_llm.mdx';