Skip to content

Commit

Permalink
Prevent mutation observer from registering duplicate locator button h…
Browse files Browse the repository at this point in the history
…andlers.
  • Loading branch information
lensvol committed Sep 17, 2021
1 parent 11e5da8 commit 437b55c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inject.js
Expand Up @@ -301,7 +301,6 @@
console.debug("[FL Genius Loci] Top stripe found!");
const locatorButtonDiv = document.createElement("div");
locatorButtonDiv.style.cssText = "display: flex; align-items: flex-end;";
locatorButton.addEventListener("click", (event) => toggleLocatorPanel());
locatorButtonDiv.appendChild(locatorButton);
locatorButtonDiv.appendChild(muteButton);

Expand All @@ -318,6 +317,7 @@
}
});

locatorButton.addEventListener("click", () => toggleLocatorPanel());
muteButton.addEventListener("click", () => {
document.dispatchEvent(new CustomEvent("FL_GL_toggleMute"));
})
Expand Down

0 comments on commit 437b55c

Please sign in to comment.