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 && (