Skip to content

Commit

Permalink
refactor some code and move to version 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolev Franco committed Jan 9, 2023
1 parent c809beb commit ec63698
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/content-script/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,17 @@ function isInNodeList(node, nodeList) {

function handleMutations(mutations) {
mutations.forEach(async function(mutation) {
const bodyInput = document.querySelectorAll(NEW_MESSAGE_INPUT, REPLAY_MESSAGE_INPUT); //:Node[]

if (!enable) {
removeChatGPTButton();
} else {
if (URL_PATTERN.test(window.location.href)) {
const bodyInput = document.querySelectorAll(NEW_MESSAGE_INPUT, REPLAY_MESSAGE_INPUT); //:Node[]
if (observer_on_new_messages.length < bodyInput.length) {
observer_on_new_messages.push(new NewMessageObserver(handleChatGPTButton, bodyInput[bodyInput.length-1]));
}

}
}
}
const bodyInput = document.querySelectorAll(NEW_MESSAGE_INPUT, REPLAY_MESSAGE_INPUT); //:Node[]

if (bodyInput.length < observer_on_new_messages.length) {
for (let i=0; i<observer_on_new_messages.length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ChatGPT for Gmail",
"description": "Display ChatGPT response as a suggestion to complete your email",
"version": "1.0.1",
"description": "Display ChatGPT response as a suggestion to complete emails",
"version": "1.0.2",
"manifest_version": 3,
"icons": {
"16": "logo.png",
Expand Down
4 changes: 2 additions & 2 deletions src/manifest.v2.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ChatGPT for Gmail",
"description": "Display ChatGPT response as a suggestion to complete your email",
"version": "1.0.1",
"description": "Display ChatGPT response as a suggestion to complete emails",
"version": "1.0.2",
"manifest_version": 2,
"icons": {
"16": "logo.png",
Expand Down

0 comments on commit ec63698

Please sign in to comment.