diff --git a/app.js b/app.js index 373042e..47e26d7 100644 --- a/app.js +++ b/app.js @@ -255,7 +255,7 @@ function addConnection(topicHex) { if (window.activePeer === peer) { window.activePeer = null; - connectionTitle.textContent = 'Disconnected'; + // connectionTitle.textContent = 'Disconnected'; dashboard.classList.add('hidden'); containerList.innerHTML = ''; } @@ -265,6 +265,15 @@ function addConnection(topicHex) { switchConnection(topicId); } }); + + // Automatically collapse the sidebar when a new connection is added + const sidebar = document.getElementById('sidebar'); + const collapseSidebarBtn = document.getElementById('collapse-sidebar-btn'); + if (!sidebar.classList.contains('collapsed')) { + sidebar.classList.add('collapsed'); + collapseSidebarBtn.innerHTML = '>'; + console.log('[DEBUG] Sidebar auto-collapsed after adding a new connection'); + } }