correctly replying and substituting text
This commit is contained in:
parent
6d9bb7cf7c
commit
26aa9b0092
1 changed files with 11 additions and 1 deletions
|
|
@ -154,7 +154,17 @@ class MessagesArea extends HTMLElement {
|
|||
actionButton.textContent = 'Use this answer';
|
||||
//actionButton.textContent = browser.i18n.getMessage("chatgpt_win_get_answer");
|
||||
actionButton.addEventListener('click', () => {
|
||||
alert('action: ' + promptData.action);
|
||||
switch(promptData.action) {
|
||||
case "1": // do reply
|
||||
browser.runtime.sendMessage({command: "chatgpt_replyMessage", text: this.fullTextHTML, tabId: promptData.tabId, mailMessageId: promptData.mailMessageId});
|
||||
browser.runtime.sendMessage({command: "chatgpt_close"});
|
||||
break;
|
||||
case "2": // replace text
|
||||
browser.runtime.sendMessage({command: "chatgpt_replaceSelectedText", text: this.fullTextHTML, tabId: promptData.tabId, mailMessageId: promptData.mailMessageId});
|
||||
//console.log(response);
|
||||
browser.runtime.sendMessage({command: "chatgpt_close"});
|
||||
break;
|
||||
}
|
||||
});
|
||||
actionButtons.appendChild(actionButton);
|
||||
this.messages.appendChild(actionButtons);
|
||||
|
|
|
|||
Loading…
Reference in a new issue