Skip to content

Commit

Permalink
fix: loop button not being added or removed.
Browse files Browse the repository at this point in the history
The code for adding or removing the loop button

when it is enabled or
  • Loading branch information
VampireChicken12 committed Oct 19, 2023
1 parent 1c7d91a commit ac04a48
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/pages/content/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import adjustVolumeOnScrollWheel from "@/src/features/scrollWheelVolumeControl";
import { setupVideoHistory, promptUserToResumeVideo } from "@/src/features/videoHistory";
import volumeBoost from "@/src/features/volumeBoost";
import { removeRemainingTimeDisplay, setupRemainingTime } from "@/src/features/remainingTime";
import { addLoopButton } from "@/src/features/loopButton";
import { addLoopButton, removeLoopButton } from "@/src/features/loopButton";
// TODO: Add always show progressbar feature

// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down Expand Up @@ -194,13 +194,9 @@ window.onload = function () {
data: { loopButtonEnabled }
} = message;
if (loopButtonEnabled) {
const loopButton = document.querySelector("button.yte-loop-button") as HTMLButtonElement | null;
if (!loopButton) return;
loopButton.style.display = "block";
addLoopButton();
} else {
const loopButton = document.querySelector("button.yte-loop-button") as HTMLButtonElement | null;
if (!loopButton) return;
loopButton.style.display = "none";
removeLoopButton();
}
break;
}
Expand Down

0 comments on commit ac04a48

Please sign in to comment.