From fd15406f5d92d65517cedad014339629857a6593 Mon Sep 17 00:00:00 2001 From: Davide Passoni Date: Thu, 8 Aug 2024 15:49:22 +0200 Subject: [PATCH] Unit control menu only opens automatically if screen is wide --- frontend/react/src/ui/ui.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/react/src/ui/ui.tsx b/frontend/react/src/ui/ui.tsx index c4137390..c8af5f23 100644 --- a/frontend/react/src/ui/ui.tsx +++ b/frontend/react/src/ui/ui.tsx @@ -60,7 +60,7 @@ export function UI() { document.addEventListener("mapStateChanged", (ev) => { if ((ev as CustomEvent).detail === IDLE) hideAllMenus(); - else if ((ev as CustomEvent).detail === CONTEXT_ACTION) setUnitControlMenuVisible(true); + else if ((ev as CustomEvent).detail === CONTEXT_ACTION && window.innerWidth > 1000) setUnitControlMenuVisible(true); setMapState(String((ev as CustomEvent).detail)); });