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)
This commit is contained in:
Fee He
2025-07-08 09:27:34 +08:00
committed by GitHub
parent 5b52b7561a
commit 30065e2f43

View File

@ -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';