From ecb1dc54f219afcc27e8ee0ada3140bbc83f5ac0 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Thu, 30 Jun 2022 00:45:24 +1000
Subject: Avoid triggering tutorial-advance via click-to-hold on active-root

---
 src/App.vue | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index 462c390..bbd3824 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -226,13 +226,14 @@ export default defineComponent({
 			if (this.isDisabled('expand')){
 				return false;
 			}
-			this.handleActionForTutorial('expand');
-			this.setLastFocused(null);
-			// If clicking child of overflowing active-root
+			// If clicking child of overflowing active-root, fail
 			if (this.overflownRoot){
 				layoutNode.failFlag = !layoutNode.failFlag; // Triggers failure animation
 				return false;
 			}
+			//
+			this.handleActionForTutorial('expand');
+			this.setLastFocused(null);
 			// Function for expanding tile
 			let doExpansion = () => {
 				let lytFnOpts = {
@@ -310,13 +311,14 @@ export default defineComponent({
 			if (this.isDisabled('expandToView')){
 				return false;
 			}
-			this.handleActionForTutorial('expandToView');
-			this.setLastFocused(null);
 			// Special case for active root
 			if (layoutNode == this.activeRoot){
 				this.onLeafClick(layoutNode);
 				return true;
 			}
+			//
+			this.handleActionForTutorial('expandToView');
+			this.setLastFocused(null);
 			// Function for expanding tile
 			let doExpansion = async () => {
 				// Hide ancestors
@@ -368,13 +370,14 @@ export default defineComponent({
 			if (this.isDisabled('expandToView')){
 				return false;
 			}
-			this.handleActionForTutorial('expandToView');
-			this.setLastFocused(null);
 			// Special case for active root
 			if (layoutNode == this.activeRoot){
 				console.log('Ignored expand-to-view on active-root node');
 				return false;
 			}
+			//
+			this.handleActionForTutorial('expandToView');
+			this.setLastFocused(null);
 			// Hide ancestors
 			LayoutNode.hideUpward(layoutNode, this.layoutMap);
 			if (this.detachedAncestors == null){ // Account for ancestry-bar transition
-- 
cgit v1.2.3

