From ce159289ba2e141ca472eab06bb5e51b915e0886 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Sat, 25 Jun 2022 20:12:29 +1000
Subject: Account for disabled-action inter-dependencies

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

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index d1d3aaa..fe86043 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -401,6 +401,10 @@ export default defineComponent({
 			//
 			let success: boolean;
 			if (collapseAndNoRelayout){
+				if (this.uiOpts.disabledActions.has('collapse')){
+					console.log('INFO: Ignored unhide-ancestor due to disabled collapse');
+					return false;
+				}
 				success = await this.onNonleafClick(layoutNode, {skipClean: true});
 			} else {
 				await this.updateAreaDims();
@@ -427,9 +431,16 @@ export default defineComponent({
 		},
 		onSearch(name: string): void {
 			if (this.modeRunning){
-				console.log("WARNING: Unexpected search event while search/auto mode is running")
+				console.log('WARNING: Unexpected search event while search/auto mode is running')
+				return;
+			}
+			let disabledActions = this.uiOpts.disabledActions;
+			if (disabledActions.has('expand') || disabledActions.has('expandToView') ||
+				disabledActions.has('unhideAncestor')){
+				console.log('INFO: Ignored search action due to disabled expand/expandToView');
 				return;
 			}
+			//
 			this.searchOpen = false;
 			this.modeRunning = true;
 			if (this.lytOpts.sweepToParent == 'fallback'){ // Temporary change for efficiency
@@ -522,6 +533,13 @@ export default defineComponent({
 		},
 		// For auto-mode events
 		onAutoIconClick(): void {
+			let disabledActions = this.uiOpts.disabledActions;
+			if (disabledActions.has('expand') || disabledActions.has('collapse') ||
+				disabledActions.has('expandToView') || disabledActions.has('unhideAncestor')){
+				console.log('INFO: Ignored auto-mode action due to disabled expand/collapse/etc');
+				return;
+			}
+			//
 			this.handleActionForTutorial('autoMode');
 			this.resetMode();
 			this.modeRunning = true;
-- 
cgit v1.2.3

