From 27a74cea8d2a4223097e36f6c1e70b9eef21bda3 Mon Sep 17 00:00:00 2001 From: Vorflux AI Date: Fri, 22 May 2026 15:14:33 +0000 Subject: [PATCH] fix: biome format and suppress exhaustive-deps warning for chatProject effect --- apps/web/components/chat/index.tsx | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/apps/web/components/chat/index.tsx b/apps/web/components/chat/index.tsx index 01b98637..bb6e304d 100644 --- a/apps/web/components/chat/index.tsx +++ b/apps/web/components/chat/index.tsx @@ -442,6 +442,7 @@ export function ChatSidebar({ }, [messages]) // Reset saveState when the active space changes so saved state doesn't carry over + // biome-ignore lint/correctness/useExhaustiveDependencies: chatProject triggers the reset but isn't used inside the effect body useEffect(() => { setSaveState("idle") }, [chatProject]) @@ -450,22 +451,22 @@ export function ChatSidebar({ if (saveStateRef.current !== "idle" || messages.length === 0) return setSaveState("saving") try { - const response = await fetch( - `${chatApiBase}/chat/save-as-document`, - { - method: "POST", - credentials: "include", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - chatId: currentChatId, - projectId: chatProject, - messages, - }), - }, - ) + const response = await fetch(`${chatApiBase}/chat/save-as-document`, { + method: "POST", + credentials: "include", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + chatId: currentChatId, + projectId: chatProject, + messages, + }), + }) if (!response.ok) throw new Error("Save failed") setSaveState("saved") - analytics.chatSavedToSpace({ chat_id: currentChatId, project_id: chatProject }) + analytics.chatSavedToSpace({ + chat_id: currentChatId, + project_id: chatProject, + }) } catch (error) { console.error("Failed to save chat:", error) setSaveState("idle")