From 964c6c60f3f1c6be5b5ca233ac8625a5ba0a9523 Mon Sep 17 00:00:00 2001 From: Raven Scott Date: Fri, 29 Nov 2024 22:46:32 -0500 Subject: [PATCH] fix --- app.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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'); + } }