We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d5a1f7 commit 6f1161cCopy full SHA for 6f1161c
frontend/src/components/Header/Chat.tsx
@@ -89,10 +89,13 @@ const Chat: React.FC<ChatDropDownProps> = ({ showChat, setShowChat }) => {
89
}
90
}, []);
91
92
+
93
// Save conversation to sessionStorage when component unmounts
94
useEffect(() => {
95
return () => {
- if (currentMessages.length > 0) {
96
+ // Only save if the user hasn't logged out
97
+ const isLoggingOut = !localStorage.getItem("access");
98
+ if (!isLoggingOut && currentMessages.length > 0) {
99
saveConversationToStorage(currentMessages, currentResponseId);
100
101
};
0 commit comments