getting the needed preferences. see #183
This commit is contained in:
parent
866aaa656b
commit
f3b81f20d1
1 changed files with 7 additions and 1 deletions
|
|
@ -20,9 +20,11 @@ import { taLogger } from "../js/mzta-logger.js";
|
||||||
|
|
||||||
let menuSendImmediately = false;
|
let menuSendImmediately = false;
|
||||||
let taLog = console;
|
let taLog = console;
|
||||||
|
let connection_type = 'chatgpt_web';
|
||||||
|
let add_tags = false;
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', async () => {
|
document.addEventListener('DOMContentLoaded', async () => {
|
||||||
let prefs = await browser.storage.sync.get({do_debug: false, dynamic_menu_force_enter: false});
|
let prefs = await browser.storage.sync.get({do_debug: false, dynamic_menu_force_enter: false, add_tags: false, connection_type: 'chatgpt_web'});
|
||||||
taLog = new taLogger("mzta-popup",prefs.do_debug);
|
taLog = new taLogger("mzta-popup",prefs.do_debug);
|
||||||
i18n.updateDocument();
|
i18n.updateDocument();
|
||||||
let reponse = await browser.runtime.sendMessage({command: "popup_menu_ready"});
|
let reponse = await browser.runtime.sendMessage({command: "popup_menu_ready"});
|
||||||
|
|
@ -35,6 +37,8 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||||
let active_prompts = filterPromptsForTab(_prompts_data, filtering);
|
let active_prompts = filterPromptsForTab(_prompts_data, filtering);
|
||||||
taLog.log("active_prompts: " + JSON.stringify(active_prompts));
|
taLog.log("active_prompts: " + JSON.stringify(active_prompts));
|
||||||
menuSendImmediately = prefs.dynamic_menu_force_enter;
|
menuSendImmediately = prefs.dynamic_menu_force_enter;
|
||||||
|
connection_type = prefs.connection_type;
|
||||||
|
add_tags = prefs.add_tags;
|
||||||
searchPrompt(active_prompts, tabId, tabType);
|
searchPrompt(active_prompts, tabId, tabType);
|
||||||
i18n.updateDocument();
|
i18n.updateDocument();
|
||||||
}, { once: true });
|
}, { once: true });
|
||||||
|
|
@ -88,6 +92,8 @@ async function searchPrompt(allPrompts, tabId, tabType){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO if add_tags is true and connection_type is not 'chatgpt_web' reserve 0 position for prompt_add_tags
|
||||||
|
|
||||||
// Prepend numbers to the first 10 items
|
// Prepend numbers to the first 10 items
|
||||||
Array.from(filteredData).slice(0, 10).forEach((item, index) => {
|
Array.from(filteredData).slice(0, 10).forEach((item, index) => {
|
||||||
const number = (index < 9) ? (index + 1).toString() : '0';
|
const number = (index < 9) ? (index + 1).toString() : '0';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue