fix(frontend): resolve react-hooks declaration order and lint errors in SupportChat [FE-001]

This commit is contained in:
devops committed 2026-10-18 15:23:12 +00:00
1 parent 73bc79b4bb
commit bb483d3e68
2 files changed
+9 -7

No files matched your search

@@ -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<AbortController | null>(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<AbortController | null>(null);
const chatScrollRef = useRef<HTMLDivElement | null>(null);
const historyKey = useRef('');
const pathname = usePathname();