From 362b03b2259c8f69ac43b26f5552d66226b4e612 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Wed, 14 Sep 2022 20:47:07 +1000
Subject: Add missing constraint for auto-mode move-down

---
 src/App.vue | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index 9e8bd8f..f7ae8c8 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -723,6 +723,9 @@ async function autoAction(){
 		if (node == activeRoot.value || node.parent!.children.length == 1){
 			actionWeights['move across'] = 0;
 		}
+		if (node.children.length == 0 || !layoutMap.value.has(node.children[0].name)){
+			actionWeights['move down'] = 0;
+		}
 		if (node == activeRoot.value){
 			actionWeights['move up'] = 0;
 		}
@@ -794,7 +797,7 @@ async function autoAction(){
 			return;
 		}
 		autoPrevActionFail.value = !success;
-		setTimeout(autoAction, store.transitionDuration + store.autoActionDelay);
+		setTimeout(autoAction, action == null ? 0 : store.transitionDuration + store.autoActionDelay);
 	}
 }
 function onAutoClose(){
-- 
cgit v1.2.3

