From c34e5f5fed864ce77c5981921a5c19a86580b905 Mon Sep 17 00:00:00 2001 From: Mic Date: Wed, 3 Sep 2025 23:18:00 +0200 Subject: [PATCH] getConnectionType method added --- js/mzta-utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/mzta-utils.js b/js/mzta-utils.js index c8a989dc..281e5296 100644 --- a/js/mzta-utils.js +++ b/js/mzta-utils.js @@ -590,6 +590,14 @@ export function isAPIKeyValue(id){ return id=="chatgpt_api_key" || id=="openai_comp_api_key" || id=="google_gemini_api_key" || id=="anthropic_api_key"; } +export function getConnectionType(conntype, prompt) { + if (prompt?.api != null && prompt.api !== '') { + return prompt.api; + } else { + return conntype; + } +} + export async function checkSparksPresence() { try { let sparks_current = await browser.runtime.sendMessage('thunderai-sparks@micz.it',{action: "checkPresence"});