From 5c2e7a63f67832c3acdb7e21bf657ba944572681 Mon Sep 17 00:00:00 2001 From: mic Date: Fri, 10 May 2024 22:15:00 +0200 Subject: [PATCH] moved onctext definitions in mzta-utils.js --- js/mzta-menus.js | 8 +++++--- js/mzta-utils.js | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/js/mzta-menus.js b/js/mzta-menus.js index a06b02f5..a227f834 100644 --- a/js/mzta-menus.js +++ b/js/mzta-menus.js @@ -19,14 +19,14 @@ // Some original methods are derived from https://github.com/ali-raheem/Aify/blob/cfadf52f576b7be3720b5b73af7c8d3129c054da/plugin/html/actions.js import { getPrompts } from './mzta-prompts.js'; -import { getLanguageDisplayName } from './mzta-utils.js' +import { getLanguageDisplayName, getMenuContextCompose, getMenuContextDisplay } from './mzta-utils.js' export class mzta_Menus { allPrompts = []; openChatGPT = null; - menu_context_compose = 'compose_action_menu'; - menu_context_display = 'message_display_action_menu'; + menu_context_compose = null; + menu_context_display = null; menu_listeners = {}; rootMenu = [ @@ -34,6 +34,8 @@ export class mzta_Menus { ]; constructor(openChatGPT) { + this.menu_context_compose = getMenuContextCompose(); + this.menu_context_display = getMenuContextDisplay(); this.openChatGPT = openChatGPT; this.allPrompts = []; } diff --git a/js/mzta-utils.js b/js/mzta-utils.js index 24efbfdc..336f2010 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -16,6 +16,9 @@ * along with this program. If not, see . */ +export const getMenuContextCompose = () => 'compose_action_menu'; +export const getMenuContextDisplay = () => 'message_display_action_menu'; + export function getLanguageDisplayName(languageCode) { const languageDisplay = new Intl.DisplayNames([languageCode], {type: 'language'});