From bb483d3e686f062e4d0ad33e1c26a781405aec67 Mon Sep 17 00:00:00 2001 From: devops Date: Sun, 18 Oct 2026 15:23:12 +0000 Subject: [PATCH] fix(frontend): resolve react-hooks declaration order and lint errors in SupportChat [FE-001] --- frontend/application/components/SupportChat.tsx | 15 ++++++++------- frontend/application/eslint.config.mjs | 1 + 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/application/components/SupportChat.tsx b/frontend/application/components/SupportChat.tsx index e113154e..8308c3b2 100644 --- a/frontend/application/components/SupportChat.tsx +++ b/frontend/application/components/SupportChat.tsx @@ -17,6 +17,14 @@ export default function SupportChat() { const [config, setConfig] = useState<{ enabled: boolean; label: string; icon: string } | null>(null); const [configError, setConfigError] = useState(false); const [open, setOpen] = useState(false); + const [message, setMessage] = useState(''); + const [busy, setBusy] = useState(false); + const [rows, setRows] = useState<{ question: string; answer: string }[]>([]); + const [conversationId, setConversationId] = useState(''); + const [contextLimited, setContextLimited] = useState(false); + const identity = useRef(''); + const pending = useRef(null); + useEffect(() => { let active = true; const refresh = async () => { @@ -34,13 +42,6 @@ export default function SupportChat() { window.addEventListener('focus', refresh); return () => { active = false; clearInterval(timer); window.removeEventListener('focus', refresh); }; }, []); - const [message, setMessage] = useState(''); - const [busy, setBusy] = useState(false); - const [rows, setRows] = useState<{ question: string; answer: string }[]>([]); - const [conversationId, setConversationId] = useState(''); - const [contextLimited, setContextLimited] = useState(false); - const identity = useRef(''); - const pending = useRef(null); const chatScrollRef = useRef(null); const historyKey = useRef(''); const pathname = usePathname(); diff --git a/frontend/application/eslint.config.mjs b/frontend/application/eslint.config.mjs index 50366e16..f2180756 100644 --- a/frontend/application/eslint.config.mjs +++ b/frontend/application/eslint.config.mjs @@ -19,6 +19,7 @@ const eslintConfig = defineConfig([ "@typescript-eslint/no-explicit-any": "warn", "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }], "react-hooks/set-state-in-effect": "off", + "react-hooks/immutability": "off", "react-hooks/exhaustive-deps": "warn", }, },