Skip to content

Commit fa35396

Browse files
committed
Remove line from the disclosure
1 parent 6f1161c commit fa35396

File tree

1 file changed

+44
-26
lines changed

1 file changed

+44
-26
lines changed

frontend/src/components/Header/Chat.tsx

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,28 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
4747
const [error, setError] = useState<Error | null>(null);
4848

4949
// Session storage functions for conversation management
50-
const saveConversationToStorage = (messages: ChatLogItem[], responseId?: string) => {
50+
const saveConversationToStorage = (
51+
messages: ChatLogItem[],
52+
responseId?: string,
53+
) => {
5154
const conversationData = {
5255
messages,
5356
responseId,
5457
timestamp: new Date().toISOString(),
5558
};
56-
sessionStorage.setItem('currentConversation', JSON.stringify(conversationData));
59+
sessionStorage.setItem(
60+
"currentConversation",
61+
JSON.stringify(conversationData),
62+
);
5763
};
5864

5965
const loadConversationFromStorage = () => {
60-
const stored = sessionStorage.getItem('currentConversation');
66+
const stored = sessionStorage.getItem("currentConversation");
6167
if (stored) {
6268
try {
6369
return JSON.parse(stored);
6470
} catch (error) {
65-
console.error('Error parsing stored conversation:', error);
71+
console.error("Error parsing stored conversation:", error);
6672
}
6773
}
6874
return null;
@@ -89,12 +95,11 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
8995
}
9096
}, []);
9197

92-
9398
// Save conversation to sessionStorage when component unmounts
9499
useEffect(() => {
95100
return () => {
96101
// Only save if the user hasn't logged out
97-
const isLoggingOut = !localStorage.getItem("access");
102+
const isLoggingOut = !localStorage.getItem("access");
98103
if (!isLoggingOut && currentMessages.length > 0) {
99104
saveConversationToStorage(currentMessages, currentResponseId);
100105
}
@@ -163,7 +168,7 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
163168
// Add user message to current conversation
164169
const updatedMessages = [...currentMessages, newMessage];
165170
setCurrentMessages(updatedMessages);
166-
171+
167172
// Save user message immediately to prevent loss
168173
saveConversationToStorage(updatedMessages, currentResponseId);
169174

@@ -184,7 +189,7 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
184189
const finalMessages = [...updatedMessages, assistantMessage];
185190
setCurrentMessages(finalMessages);
186191
setCurrentResponseId(data.final_response_id);
187-
192+
188193
// Save conversation to sessionStorage
189194
saveConversationToStorage(finalMessages, data.final_response_id);
190195
} catch (error) {
@@ -257,7 +262,7 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
257262
onClick={() => {
258263
setCurrentMessages([]);
259264
setCurrentResponseId(undefined);
260-
sessionStorage.removeItem('currentConversation');
265+
sessionStorage.removeItem("currentConversation");
261266
}}
262267
className="flex items-center justify-center"
263268
title="New Conversation"
@@ -313,25 +318,38 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
313318
Learn more about my sources.
314319
</Link>
315320
</div>
316-
<div className="chat_bubble chat_bubble_header" style={{
317-
backgroundColor: '#fef3c7',
318-
border: '1px solid #f59e0b',
319-
marginTop: '10px'
320-
}}>
321-
<h6 style={{ color: '#92400e', fontWeight: 'bold', marginBottom: '8px' }}>
321+
<div
322+
className="chat_bubble chat_bubble_header"
323+
style={{
324+
backgroundColor: "#fef3c7",
325+
border: "1px solid #f59e0b",
326+
marginTop: "10px",
327+
}}
328+
>
329+
<h6
330+
style={{
331+
color: "#92400e",
332+
fontWeight: "bold",
333+
marginBottom: "8px",
334+
}}
335+
>
322336
⚠️ IMPORTANT NOTICE
323337
</h6>
324-
<p style={{
325-
fontSize: '0.85em',
326-
color: '#92400e',
327-
lineHeight: '1.4',
328-
margin: '0'
329-
}}>
330-
Balancer is NOT configured for use with Protected Health Information (PHI) as defined under HIPAA.
331-
You must NOT enter any patient-identifiable information including names, addresses, dates of birth,
332-
medical record numbers, or any other identifying information. Your queries may be processed by
333-
third-party AI services that retain data for up to 30 days for abuse monitoring. By using Balancer,
334-
you certify that you understand these restrictions and will not enter any PHI.
338+
<p
339+
style={{
340+
fontSize: "0.85em",
341+
color: "#92400e",
342+
lineHeight: "1.4",
343+
margin: "0",
344+
}}
345+
>
346+
Balancer is NOT configured for use with Protected Health
347+
Information (PHI) as defined under HIPAA. You must NOT
348+
enter any patient-identifiable information including
349+
names, addresses, dates of birth, medical record
350+
numbers, or any other identifying information. By using
351+
Balancer, you certify that you understand these
352+
restrictions and will not enter any PHI.
335353
</p>
336354
</div>
337355
<div className="chat_suggestion_section">

0 commit comments

Comments
 (0)