From 8321e2f92dbc073b8f1de87895d6620a2021b22e Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Fri, 20 Jan 2023 21:56:53 +1100
Subject: Relayout events upon category changes

---
 src/components/SettingsModal.vue | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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

diff --git a/src/components/SettingsModal.vue b/src/components/SettingsModal.vue
index 3e56373..04b5e76 100644
--- a/src/components/SettingsModal.vue
+++ b/src/components/SettingsModal.vue
@@ -110,9 +110,14 @@ const lastCtg = computed(() => { // When all but one category is disabled, names
 		return null;
 	}
 });
+let changedCtg: string | null = null; // Used to defer signalling of a category change until modal closes
 function onSettingChg(option: string){ 
 	store.save(option);
-	emit('change', option);
+	if (option.startsWith('ctgs.')){
+		changedCtg = option;
+	} else {
+		emit('change', option);
+	}
 	// Make 'Saved' indicator appear/animate
 	if (!saved.value){
 		saved.value = true;
@@ -137,6 +142,9 @@ function onReset(){
 function onClose(evt: Event){
 	if (evt.target == rootRef.value || closeRef.value!.$el.contains(evt.target)){
 		emit('close');
+		if (changedCtg != null){
+			emit('change', changedCtg);
+		}
 	}
 }
 
-- 
cgit v1.2.3

