some fixes ported from 2.0.6
This commit is contained in:
parent
135113ada9
commit
dd2e084bb4
2 changed files with 12 additions and 11 deletions
|
|
@ -235,14 +235,15 @@ class MessagesArea extends HTMLElement {
|
||||||
switch(promptData.action) {
|
switch(promptData.action) {
|
||||||
case "1": // do reply
|
case "1": // do reply
|
||||||
// console.log("[ThunderAI] (do reply) fullTextHTMLAtAssignment: " + fullTextHTMLAtAssignment);
|
// console.log("[ThunderAI] (do reply) fullTextHTMLAtAssignment: " + fullTextHTMLAtAssignment);
|
||||||
browser.runtime.sendMessage({command: "chatgpt_replyMessage", text: fullTextHTMLAtAssignment, tabId: promptData.tabId, mailMessageId: promptData.mailMessageId});
|
browser.runtime.sendMessage({command: "chatgpt_replyMessage", text: fullTextHTMLAtAssignment, tabId: promptData.tabId, mailMessageId: promptData.mailMessageId}).then(() => {
|
||||||
browser.runtime.sendMessage({command: "chatgpt_close"});
|
browser.runtime.sendMessage({command: "chatgpt_close"});
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case "2": // replace text
|
case "2": // replace text
|
||||||
// console.log("[ThunderAI] (replace text) fullTextHTMLAtAssignment: " + fullTextHTMLAtAssignment);
|
// console.log("[ThunderAI] (replace text) fullTextHTMLAtAssignment: " + fullTextHTMLAtAssignment);
|
||||||
browser.runtime.sendMessage({command: "chatgpt_replaceSelectedText", text: fullTextHTMLAtAssignment, tabId: promptData.tabId, mailMessageId: promptData.mailMessageId});
|
browser.runtime.sendMessage({command: "chatgpt_replaceSelectedText", text: fullTextHTMLAtAssignment, tabId: promptData.tabId, mailMessageId: promptData.mailMessageId}).then(() => {
|
||||||
//console.log(response);
|
browser.runtime.sendMessage({command: "chatgpt_close"});
|
||||||
browser.runtime.sendMessage({command: "chatgpt_close"});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -167,9 +167,9 @@ function addCustomDiv(prompt_action,tabId,mailMessageId) {
|
||||||
btn_ok.textContent = browser.i18n.getMessage("chatgpt_win_get_answer");
|
btn_ok.textContent = browser.i18n.getMessage("chatgpt_win_get_answer");
|
||||||
btn_ok.onclick = async function() {
|
btn_ok.onclick = async function() {
|
||||||
const response = getSelectedHtml();
|
const response = getSelectedHtml();
|
||||||
browser.runtime.sendMessage({command: "chatgpt_replyMessage", text: response, tabId: tabId, mailMessageId: mailMessageId});
|
browser.runtime.sendMessage({command: "chatgpt_replyMessage", text: response, tabId: tabId, mailMessageId: mailMessageId}).then(() => {
|
||||||
//console.log(response);
|
browser.runtime.sendMessage({command: "chatgpt_close"});
|
||||||
browser.runtime.sendMessage({command: "chatgpt_close"});
|
});
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case "2": // replace text
|
case "2": // replace text
|
||||||
|
|
@ -178,9 +178,9 @@ function addCustomDiv(prompt_action,tabId,mailMessageId) {
|
||||||
btn_ok.onclick = async function() {
|
btn_ok.onclick = async function() {
|
||||||
const response = getSelectedHtml();
|
const response = getSelectedHtml();
|
||||||
//console.log('replace text: '+tabId)
|
//console.log('replace text: '+tabId)
|
||||||
browser.runtime.sendMessage({command: "chatgpt_replaceSelectedText", text: response, tabId: tabId, mailMessageId: mailMessageId});
|
browser.runtime.sendMessage({command: "chatgpt_replaceSelectedText", text: response, tabId: tabId, mailMessageId: mailMessageId}).then(() => {
|
||||||
//console.log(response);
|
browser.runtime.sendMessage({command: "chatgpt_close"});
|
||||||
browser.runtime.sendMessage({command: "chatgpt_close"});
|
});
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue