Fix selection text handling in menu actions to ensure proper text assignment when using mail_typed_text placeholder
This commit is contained in:
parent
3a6e1df1d3
commit
9ddfbeaeda
1 changed files with 6 additions and 1 deletions
|
|
@ -105,11 +105,16 @@ export class mzta_Menus {
|
||||||
let body_text = '';
|
let body_text = '';
|
||||||
let selection_text = '';
|
let selection_text = '';
|
||||||
let only_typed_text = '';
|
let only_typed_text = '';
|
||||||
|
only_typed_text = msg_text.only_typed_text.replace(/\s+/g, ' ').trim();
|
||||||
selection_text = msg_text.selection.replace(/\s+/g, ' ').trim();
|
selection_text = msg_text.selection.replace(/\s+/g, ' ').trim();
|
||||||
|
if(selection_text === ''){
|
||||||
|
if(placeholdersUtils.hasPlaceholder(curr_prompt.text, "mail_typed_text")){
|
||||||
|
selection_text = only_typed_text;
|
||||||
|
}
|
||||||
|
}
|
||||||
curr_prompt.selection_text = selection_text;
|
curr_prompt.selection_text = selection_text;
|
||||||
body_text = msg_text.text.replace(/\s+/g, ' ').trim();
|
body_text = msg_text.text.replace(/\s+/g, ' ').trim();
|
||||||
curr_prompt.body_text = body_text;
|
curr_prompt.body_text = body_text;
|
||||||
only_typed_text = msg_text.only_typed_text.replace(/\s+/g, ' ').trim();
|
|
||||||
//open chatgpt window
|
//open chatgpt window
|
||||||
//console.log("Click menu item...");
|
//console.log("Click menu item...");
|
||||||
let chatgpt_lang = await taPromptUtils.getDefaultLang(curr_prompt);
|
let chatgpt_lang = await taPromptUtils.getDefaultLang(curr_prompt);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue