From 22a7a6d3d57253ea33a2a8127e0df730d4f3caaa Mon Sep 17 00:00:00 2001 From: Abdurrahman Rajab Date: Thu, 9 Nov 2023 18:10:35 +0300 Subject: [PATCH 1/3] chore: refactor the code --- src/utils/dom-utils/addDescriptionGenerator.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/utils/dom-utils/addDescriptionGenerator.ts b/src/utils/dom-utils/addDescriptionGenerator.ts index 6a1d679..4db70cb 100644 --- a/src/utils/dom-utils/addDescriptionGenerator.ts +++ b/src/utils/dom-utils/addDescriptionGenerator.ts @@ -21,13 +21,11 @@ const injectDescriptionGeneratorButton = async () => { } } - const prActionsClassName = "ActionBar-item-container"; - const actionBars = document.getElementsByClassName(prActionsClassName); - const actionBarsArray = Array.from(actionBars); - const addGeneratorButton = DescriptionGeneratorButton(); - const firstPrDescription = actionBarsArray[0]; + const firstPrDescription = document.querySelector(".ActionBar-item-container"); + + if (firstPrDescription && !firstPrDescription.querySelector("#ai-description-button")) { + const addGeneratorButton = DescriptionGeneratorButton(); - if (!firstPrDescription.querySelector("#ai-description-button")) { firstPrDescription.insertBefore(addGeneratorButton, firstPrDescription.firstChild); } }; From cc7427c6fba1ac8526b77edc1e9c6457cb95725f Mon Sep 17 00:00:00 2001 From: Abdurrahman Rajab Date: Thu, 9 Nov 2023 18:17:01 +0300 Subject: [PATCH 2/3] chore: lint and format --- src/utils/dom-utils/addDescriptionGenerator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/dom-utils/addDescriptionGenerator.ts b/src/utils/dom-utils/addDescriptionGenerator.ts index 4db70cb..81eb965 100644 --- a/src/utils/dom-utils/addDescriptionGenerator.ts +++ b/src/utils/dom-utils/addDescriptionGenerator.ts @@ -22,7 +22,7 @@ const injectDescriptionGeneratorButton = async () => { } const firstPrDescription = document.querySelector(".ActionBar-item-container"); - + if (firstPrDescription && !firstPrDescription.querySelector("#ai-description-button")) { const addGeneratorButton = DescriptionGeneratorButton(); From bc44a669e6dfa892431739069b27baa7c04d883f Mon Sep 17 00:00:00 2001 From: Nick Taylor Date: Thu, 9 Nov 2023 16:42:27 +0000 Subject: [PATCH 3/3] chore(patch): release 1.14.3-beta.1 on beta channel [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [1.14.3-beta.1](https://github.com/open-sauced/ai/compare/v1.14.2...v1.14.3-beta.1) (2023-11-09) ### 🐛 Bug Fixes * change the classname and remove extra code ([241c385](https://github.com/open-sauced/ai/commit/241c385e82f3757b95b045423fbb01e512772bfd)) * elemenet to the dom if it's not added already ([c654b82](https://github.com/open-sauced/ai/commit/c654b826d2443adc6cffbeaa61970b6294596ca6)) --- CHANGELOG.md | 8 ++++++++ npm-shrinkwrap.json | 4 ++-- package.json | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c6d630..fdf8c4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ > All notable changes to this project will be documented in this file +## [1.14.3-beta.1](https://github.com/open-sauced/ai/compare/v1.14.2...v1.14.3-beta.1) (2023-11-09) + + +### 🐛 Bug Fixes + +* change the classname and remove extra code ([241c385](https://github.com/open-sauced/ai/commit/241c385e82f3757b95b045423fbb01e512772bfd)) +* elemenet to the dom if it's not added already ([c654b82](https://github.com/open-sauced/ai/commit/c654b826d2443adc6cffbeaa61970b6294596ca6)) + ## [1.14.2](https://github.com/open-sauced/ai/compare/v1.14.1...v1.14.2) (2023-11-06) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index db15227..f9f94a9 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,12 +1,12 @@ { "name": "opensauced-browser-extension", - "version": "1.14.2", + "version": "1.14.3-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "opensauced-browser-extension", - "version": "1.14.2", + "version": "1.14.3-beta.1", "dependencies": { "date-fns": "^2.30.0", "gpt-tokenizer": "^1.0.5", diff --git a/package.json b/package.json index 2464b7d..68fa540 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "opensauced-browser-extension", "private": true, - "version": "1.14.2", + "version": "1.14.3-beta.1", "files": [ "dist" ],