Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,29 @@ async function init() {
TryAgainButton = parentNode.querySelector("button");
}
addActionsButtons(actionsArea, TryAgainButton);
} else if(shouldRemoveButtons()){
} else if (shouldRemoveButtons()) {
removeButtons();
}
}, 200);
}

function shouldRemoveButtons() {
const isOpenScreen = document.querySelector("h1.text-4xl");
if(isOpenScreen){
if (isOpenScreen) {
return true;
}
const inConversation = document.querySelector("form button>div");
if(inConversation){
return true;
if (inConversation) {
if (inConversation.innerText.indexOf('Regen') < 0) {
return true
}
}
return false;
}

function shouldAddButtons(actionsArea) {
// if it should remove the button, then it shouldn't add it back, otherwise there will be an annoying loop and blinking buttons
if(shouldRemoveButtons()){
if (shouldRemoveButtons()) {
return false;
}

Expand Down