aboutsummaryrefslogtreecommitdiff
path: root/src/components/SettingsModal.vue
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2023-01-20 21:56:53 +1100
committerTerry Truong <terry06890@gmail.com>2023-01-20 21:56:53 +1100
commit8321e2f92dbc073b8f1de87895d6620a2021b22e (patch)
tree50e7f2d50aaec68ca90aa46539d05cab5249ffe1 /src/components/SettingsModal.vue
parente6b9c10f0f1eefee556833d98a1f322856dcbb7e (diff)
Relayout events upon category changes
Diffstat (limited to 'src/components/SettingsModal.vue')
-rw-r--r--src/components/SettingsModal.vue10
1 files changed, 9 insertions, 1 deletions
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);
+ }
}
}