From 6605fbcab6418154a76d01876c3a82bde4067e96 Mon Sep 17 00:00:00 2001 From: Jerome Date: Thu, 12 Jun 2025 15:11:26 +0100 Subject: [PATCH] Rename logout to reset and clear all localStorage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/components/ConversationSidebar.tsx | 30 ++++++++++++++------------ 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/components/ConversationSidebar.tsx b/src/components/ConversationSidebar.tsx index 75cb848..c1260db 100644 --- a/src/components/ConversationSidebar.tsx +++ b/src/components/ConversationSidebar.tsx @@ -20,24 +20,26 @@ export function ConversationSidebar() { createConversation(); }; - const handleLogout = () => { - if (confirm('Are you sure you want to log out? This will disconnect all MCP servers and clear your authentication.')) { + const handleReset = () => { + if (confirm('Are you sure you want to reset the application? This will clear all data including conversations, authentication, and server connections.')) { // Clear inference provider authentication clearProvider(); - // Clear MCP OAuth tokens for all connections - connections.forEach(connection => { - if (connection.authType === 'oauth') { - // Clear OAuth tokens and state for this connection - localStorage.removeItem(`mcp_oauth_tokens_${connection.id}`); - localStorage.removeItem(`mcp_oauth_state_${connection.id}`); - } - }); - // Remove all MCP servers (this will disconnect them) connections.forEach(connection => { removeMcpServer(connection.id); }); + + // Clear all conversations + conversations.forEach(conversation => { + deleteConversation(conversation.id); + }); + + // Clear ALL localStorage data + localStorage.clear(); + + // Refresh the page to ensure clean state + window.location.reload(); } }; @@ -142,14 +144,14 @@ export function ConversationSidebar() { )} - {/* Logout Button */} + {/* Reset Button */} {provider && (
)}