correctly handling multiple answers
This commit is contained in:
parent
2646009826
commit
3e06b683da
1 changed files with 3 additions and 2 deletions
|
|
@ -227,14 +227,15 @@ class MessagesArea extends HTMLElement {
|
||||||
const actionButton = document.createElement('button');
|
const actionButton = document.createElement('button');
|
||||||
actionButton.textContent = 'Use this answer';
|
actionButton.textContent = 'Use this answer';
|
||||||
//actionButton.textContent = browser.i18n.getMessage("chatgpt_win_get_answer");
|
//actionButton.textContent = browser.i18n.getMessage("chatgpt_win_get_answer");
|
||||||
|
const fullTextHTMLAtAssignment = this.fullTextHTML;
|
||||||
actionButton.addEventListener('click', () => {
|
actionButton.addEventListener('click', () => {
|
||||||
switch(promptData.action) {
|
switch(promptData.action) {
|
||||||
case "1": // do reply
|
case "1": // do reply
|
||||||
browser.runtime.sendMessage({command: "chatgpt_replyMessage", text: this.fullTextHTML, tabId: promptData.tabId, mailMessageId: promptData.mailMessageId});
|
browser.runtime.sendMessage({command: "chatgpt_replyMessage", text: fullTextHTMLAtAssignment, tabId: promptData.tabId, mailMessageId: promptData.mailMessageId});
|
||||||
browser.runtime.sendMessage({command: "chatgpt_close"});
|
browser.runtime.sendMessage({command: "chatgpt_close"});
|
||||||
break;
|
break;
|
||||||
case "2": // replace text
|
case "2": // replace text
|
||||||
browser.runtime.sendMessage({command: "chatgpt_replaceSelectedText", text: this.fullTextHTML, tabId: promptData.tabId, mailMessageId: promptData.mailMessageId});
|
browser.runtime.sendMessage({command: "chatgpt_replaceSelectedText", text: fullTextHTMLAtAssignment, tabId: promptData.tabId, mailMessageId: promptData.mailMessageId});
|
||||||
//console.log(response);
|
//console.log(response);
|
||||||
browser.runtime.sendMessage({command: "chatgpt_close"});
|
browser.runtime.sendMessage({command: "chatgpt_close"});
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue