Skip to content

Commit

Permalink
fix: Features being enabled multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
VampireChicken12 committed Jul 4, 2024
1 parent a045698 commit f758184
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/embedded/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ const getFeatureFunctions = (featureName: AllButtonNames, oldPlacement: ButtonPl
};
};
function handleSoftNavigate() {
// Listen to YouTube's soft navigate event
// Remove existing listeners
document.removeEventListener("yt-navigate-finish", enableFeatures);
document.removeEventListener("yt-player-updated", enableFeatures);
// Add listeners
document.addEventListener("yt-navigate-finish", enableFeatures);
document.addEventListener("yt-player-updated", enableFeatures);
}
Expand Down

0 comments on commit f758184

Please sign in to comment.