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" ], diff --git a/src/utils/dom-utils/addDescriptionGenerator.ts b/src/utils/dom-utils/addDescriptionGenerator.ts index 11c8db9..08aa611 100644 --- a/src/utils/dom-utils/addDescriptionGenerator.ts +++ b/src/utils/dom-utils/addDescriptionGenerator.ts @@ -21,16 +21,12 @@ const injectDescriptionGeneratorButton = async () => { } } - const prActionsClassName = "ActionBar-item-container"; - const actionBars = document.getElementsByClassName(prActionsClassName); - const actionBarsArray = Array.from(actionBars); - - actionBarsArray.forEach((actionBar, index) => { - if (!actionBar.querySelector(`#ai-description-button-${index}`)) { - const addGeneratorButton = DescriptionGeneratorButton(index); - - actionBar.insertBefore(addGeneratorButton, actionBar.firstChild); - } + const actionBars = document.querySelectorAll(".ActionBar-item-container"); + actionBars.forEach((actionBar, index) => { + if (firstPrDescription && !firstPrDescription.querySelector(`#ai-description-button-${index}`)) { + const addGeneratorButton = DescriptionGeneratorButton(index); + firstPrDescription.insertBefore(addGeneratorButton, firstPrDescription.firstChild); + } }); };