From 57e9a050836fdd73c56e384c7455fe847b721661 Mon Sep 17 00:00:00 2001 From: mic Date: Fri, 22 Aug 2025 23:33:53 +0200 Subject: [PATCH] fix correctly showing the context menu when changing connection type --- mzta-background.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mzta-background.js b/mzta-background.js index ac5196df..437028ae 100644 --- a/mzta-background.js +++ b/mzta-background.js @@ -818,6 +818,13 @@ function setupStorageChangeListener() { if(newConnectionType === "chatgpt_web"){ removeContextMenu(contextMenuID_AddTags); removeContextMenu(contextMenuID_Spamfilter); + }else{ + if(prefs_init.add_tags && prefs_init.add_tags_context_menu){ + addContextMenu(contextMenuID_AddTags); + } + if(prefs_init.spamfilter && prefs_init.spamfilter_context_menu){ + addContextMenu(contextMenuID_Spamfilter); + } } } @@ -902,12 +909,12 @@ function removeContextMenu(menu_id) { } // Add Context menu: Add tags -if(prefs_init.add_tags && prefs_init.add_tags_context_menu){ +if(prefs_init.add_tags && prefs_init.add_tags_context_menu && (prefs_init.connection_type !== "chatgpt_web")){ addContextMenu(contextMenuID_AddTags); } // Add Context menu: Spamfilter -if(prefs_init.spamfilter && prefs_init.spamfilter_context_menu){ +if(prefs_init.spamfilter && prefs_init.spamfilter_context_menu && (prefs_init.connection_type !== "chatgpt_web")){ addContextMenu(contextMenuID_Spamfilter); }