curr_message null error when there are no placeholders fixed. see #206
This commit is contained in:
parent
f6e73f5481
commit
b6c19e11b3
1 changed files with 17 additions and 15 deletions
|
|
@ -117,14 +117,7 @@ export class mzta_Menus {
|
||||||
|
|
||||||
let fullPrompt = '';
|
let fullPrompt = '';
|
||||||
let full_tags_list = await getTagsList();
|
let full_tags_list = await getTagsList();
|
||||||
if(!placeholdersUtils.hasPlaceholder(curr_prompt.text)){
|
|
||||||
// no placeholders, do as usual
|
|
||||||
fullPrompt = curr_prompt.text + (String(curr_prompt.need_signature) == "1" ? " " + await this.getDefaultSignature():"") + " " + chatgpt_lang + " \"" + (selection_text=='' ? body_text : selection_text) + "\" ";
|
|
||||||
}else{
|
|
||||||
// we have at least a placeholder, do the magic!
|
|
||||||
let currPHs = await placeholdersUtils.extractPlaceholders(curr_prompt.text);
|
|
||||||
// console.log(">>>>>>>>>> currPHs: " + JSON.stringify(currPHs));
|
|
||||||
let finalSubs = {};
|
|
||||||
let curr_messages = null;
|
let curr_messages = null;
|
||||||
switch(tabs[0].type){
|
switch(tabs[0].type){
|
||||||
case 'mail':
|
case 'mail':
|
||||||
|
|
@ -140,6 +133,15 @@ export class mzta_Menus {
|
||||||
curr_message = curr_messages;
|
curr_message = curr_messages;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!placeholdersUtils.hasPlaceholder(curr_prompt.text)){
|
||||||
|
// no placeholders, do as usual
|
||||||
|
fullPrompt = curr_prompt.text + (String(curr_prompt.need_signature) == "1" ? " " + await this.getDefaultSignature():"") + " " + chatgpt_lang + " \"" + (selection_text=='' ? body_text : selection_text) + "\" ";
|
||||||
|
}else{
|
||||||
|
// we have at least a placeholder, do the magic!
|
||||||
|
let currPHs = await placeholdersUtils.extractPlaceholders(curr_prompt.text);
|
||||||
|
// console.log(">>>>>>>>>> currPHs: " + JSON.stringify(currPHs));
|
||||||
|
let finalSubs = {};
|
||||||
for(let currPH of currPHs){
|
for(let currPH of currPHs){
|
||||||
switch(currPH.id){
|
switch(currPH.id){
|
||||||
case 'mail_text_body':
|
case 'mail_text_body':
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue