From e1ad9d9c5d25ebfab5ccd2165513cba2639c4247 Mon Sep 17 00:00:00 2001 From: Mic Date: Wed, 16 Apr 2025 23:59:00 +0200 Subject: [PATCH] Handle 'get_task' changes in setupStorageChangeListener to update special prompts IDs accordingly. see #333 --- mzta-background.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/mzta-background.js b/mzta-background.js index 023d362d..cd7238f7 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -676,6 +676,20 @@ function setupStorageChangeListener() { menus.reload(special_prompts_ids); } + // Process 'get_task' changes + if (changes.get_task) { + const newTask = changes.get_task.newValue; + let getCalendarEvent = doGetSparkFeature(prefs_init.get_calendar_event); + let getTask = doGetSparkFeature(newTask); + const special_prompts_ids = getActiveSpecialPromptsIDs({ + addtags: prefs_init.add_tags, + get_calendar_event: getCalendarEvent, + get_task: getTask, + is_chatgpt_web: (prefs_init.connection_type === "chatgpt_web") + }); + menus.reload(special_prompts_ids); + } + // Process 'connection_type' changes if (changes.connection_type) { const newConnectionType = changes.connection_type.newValue;