prevent selecting the active server
All checks were successful
Build and Push Docker Image / build (push) Successful in 14s

instead, hide the sidebar on smaller screens, so that the user's input doesn't feel unresponsive.
This commit is contained in:
Corban-Lee Jones 2024-10-10 22:24:58 +01:00
parent 49dfb59d71
commit 15ce3c1dbb

View File

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