Handle 'get_task' changes in setupStorageChangeListener to update special prompts IDs accordingly. see #333

This commit is contained in:
Mic 2025-04-16 23:59:00 +02:00
parent 12d54d8a31
commit e1ad9d9c5d

View file

@ -676,6 +676,20 @@ function setupStorageChangeListener() {
menus.reload(special_prompts_ids); 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 // Process 'connection_type' changes
if (changes.connection_type) { if (changes.connection_type) {
const newConnectionType = changes.connection_type.newValue; const newConnectionType = changes.connection_type.newValue;