Skip to content

Commit 6605fbc

Browse files
Rename logout to reset and clear all localStorage
- Renamed "Log Out" button to "Reset All Data" to better reflect functionality - Renamed handleLogout to handleReset for consistency - Updated confirmation dialog text to say "reset the application" - Replaced selective localStorage clearing with localStorage.clear() for complete data removal - Ensures all conversations, authentication, and MCP data is properly cleared 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 253db5e commit 6605fbc

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/components/ConversationSidebar.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,26 @@ export function ConversationSidebar() {
2020
createConversation();
2121
};
2222

23-
const handleLogout = () => {
24-
if (confirm('Are you sure you want to log out? This will disconnect all MCP servers and clear your authentication.')) {
23+
const handleReset = () => {
24+
if (confirm('Are you sure you want to reset the application? This will clear all data including conversations, authentication, and server connections.')) {
2525
// Clear inference provider authentication
2626
clearProvider();
2727

28-
// Clear MCP OAuth tokens for all connections
29-
connections.forEach(connection => {
30-
if (connection.authType === 'oauth') {
31-
// Clear OAuth tokens and state for this connection
32-
localStorage.removeItem(`mcp_oauth_tokens_${connection.id}`);
33-
localStorage.removeItem(`mcp_oauth_state_${connection.id}`);
34-
}
35-
});
36-
3728
// Remove all MCP servers (this will disconnect them)
3829
connections.forEach(connection => {
3930
removeMcpServer(connection.id);
4031
});
32+
33+
// Clear all conversations
34+
conversations.forEach(conversation => {
35+
deleteConversation(conversation.id);
36+
});
37+
38+
// Clear ALL localStorage data
39+
localStorage.clear();
40+
41+
// Refresh the page to ensure clean state
42+
window.location.reload();
4143
}
4244
};
4345

@@ -142,14 +144,14 @@ export function ConversationSidebar() {
142144
)}
143145
</div>
144146

145-
{/* Logout Button */}
147+
{/* Reset Button */}
146148
{provider && (
147149
<div className="p-4 border-t border-gray-200 dark:border-gray-700">
148150
<button
149-
onClick={handleLogout}
151+
onClick={handleReset}
150152
className="w-full px-4 py-2 text-sm bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors"
151153
>
152-
Log Out
154+
Reset All Data
153155
</button>
154156
</div>
155157
)}

0 commit comments

Comments
 (0)