From db5b4f3069fbe30f6daabffeddf2868d5e8c5240 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Fri, 24 Jun 2022 13:37:06 +1000
Subject: Fix search-bar mode-change button not saving setting

Also fix jump-to-search-result not flashing node in some cases.
---
 src/components/SearchModal.vue | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'src/components/SearchModal.vue')

diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue
index 585b535..dc9da4c 100644
--- a/src/components/SearchModal.vue
+++ b/src/components/SearchModal.vue
@@ -34,13 +34,13 @@ export default defineComponent({
 			};
 		},
 		suggDisplayStrings(): [string, string, string][] {
-			let result = [];
-			let input = this.$refs.searchInput.value;
+			let result: [string, string, string][] = [];
+			let input = (this.$refs.searchInput as HTMLInputElement).value;
 			// For each SearchSugg
 			for (let sugg of this.searchSuggs){
 				let idx = sugg.name.indexOf(input);
 				// Split suggestion text into parts before/within/after an input match
-				let strings;
+				let strings: [string, string, string];
 				if (idx != -1){
 					strings = [sugg.name.substring(0, idx), input, sugg.name.substring(idx + input.length)];
 				} else {
@@ -72,6 +72,7 @@ export default defineComponent({
 		},
 		onSearchModeChg(){
 			this.uiOpts.jumpToSearchedNode = !this.uiOpts.jumpToSearchedNode;
+			this.$emit('settings-chg', [], ['jumpToSearchedNode']);
 		},
 		resolveSearch(tolNodeName: string){
 			if (tolNodeName == ''){
@@ -190,7 +191,7 @@ export default defineComponent({
 		(this.$refs.searchInput as HTMLInputElement).focus();
 	},
 	components: {SearchIcon, InfoIcon, LogInIcon, },
-	emits: ['search', 'close', 'info-click'],
+	emits: ['search', 'close', 'info-click', 'settings-chg', ],
 });
 </script>
 
-- 
cgit v1.2.3

