diff --git a/apps/home/static/home/js/servers.js b/apps/home/static/home/js/servers.js index efe2c3f..041cb9a 100644 --- a/apps/home/static/home/js/servers.js +++ b/apps/home/static/home/js/servers.js @@ -90,7 +90,10 @@ function createSelectButton(serverData) { // Bind the button for selecting this server template.find(".sidebar-item").off("click").on("click", function() { - selectServer($(this).data("id")); + const myID = $(this).data("id"); + + // only select if not already selected, otherwise hide sidebar on smaller screens (responsive) + selectedServer?.id !== myID ? selectServer(myID) : setSidebarVisibility(false); }); $("#serverList").prepend(template);