Skip to content

Commit

Permalink
fix liady#50
Browse files Browse the repository at this point in the history
  • Loading branch information
pangwa committed Mar 16, 2023
1 parent cd4e8cd commit 44b773f
Showing 1 changed file with 7 additions and 5 deletions.
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

0 comments on commit 44b773f

Please sign in to comment.