forcing to string before checking 0/1 properties
This commit is contained in:
parent
5122edadac
commit
58ddddb241
1 changed files with 2 additions and 2 deletions
|
|
@ -75,7 +75,7 @@ export class mzta_Menus {
|
||||||
const msg_text = await getHighlight();
|
const msg_text = await getHighlight();
|
||||||
|
|
||||||
//check if a selection is needed
|
//check if a selection is needed
|
||||||
if(curr_prompt.need_selected && (msg_text.selection==='')){
|
if(String(curr_prompt.need_selected) == "1" && (msg_text.selection==='')){
|
||||||
//A selection is needed, but nothing is selected!
|
//A selection is needed, but nothing is selected!
|
||||||
//alert(browser.i18n.getMessage('prompt_selection_needed'));
|
//alert(browser.i18n.getMessage('prompt_selection_needed'));
|
||||||
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||||
|
|
@ -94,7 +94,7 @@ export class mzta_Menus {
|
||||||
let prefs = await browser.storage.sync.get({default_chatgpt_lang: getLanguageDisplayName(browser.i18n.getUILanguage())});
|
let prefs = await browser.storage.sync.get({default_chatgpt_lang: getLanguageDisplayName(browser.i18n.getUILanguage())});
|
||||||
let chatgpt_lang = prefs.default_chatgpt_lang;
|
let chatgpt_lang = prefs.default_chatgpt_lang;
|
||||||
|
|
||||||
var fullPrompt = curr_prompt.text + (curr_prompt.need_signature ? " " + await this.getDefaultSignature():"") + " " + browser.i18n.getMessage("prompt_lang") + chatgpt_lang + ". \"" + body_text + "\" ";
|
var fullPrompt = curr_prompt.text + (String(curr_prompt.need_signature) == "1" ? " " + await this.getDefaultSignature():"") + " " + browser.i18n.getMessage("prompt_lang") + chatgpt_lang + ". \"" + body_text + "\" ";
|
||||||
|
|
||||||
switch(curr_prompt.id){
|
switch(curr_prompt.id){
|
||||||
case 'prompt_translate_this':
|
case 'prompt_translate_this':
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue