ui/fix: frozen map after clicking machine

This commit is contained in:
Johannes Kirschbauer
2025-09-02 12:40:23 +02:00
parent a8cbfcbd18
commit 2af9bd5003

View File

@@ -582,18 +582,15 @@ export function CubeScene(props: {
}; };
const handleMouseUp = (e: MouseEvent) => { const handleMouseUp = (e: MouseEvent) => {
if (e.button === 0) { if (e.button === 0) {
console.log("Left mouse up");
setIsDragging(false); setIsDragging(false);
if (cancelMove()) { if (cancelMove()) {
clearTimeout(cancelMove()!); clearTimeout(cancelMove()!);
setCancelMove(undefined); setCancelMove(undefined);
} }
// Always re-enable controls
controls.enabled = true;
if (worldMode() === "move") { if (worldMode() === "move") {
// Cancel long-press if it wasn't triggered yet
// Re-enable controls
controls.enabled = true;
// Set machine as not flying // Set machine as not flying
props.setMachinePos( props.setMachinePos(
highlightGroups["move"].values().next().value!, highlightGroups["move"].values().next().value!,