This commit is contained in:
Raven Scott 2024-11-29 22:46:32 -05:00
parent 93c40af76a
commit 964c6c60f3

11
app.js
View File

@ -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');
}
}