1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Restore logic to avoid live poll on pages that don't have the button

This commit is contained in:
Mike Perham 2021-10-27 16:38:53 -07:00
parent 767217133e
commit 5e295b0a88

View file

@ -41,7 +41,9 @@ ready(() => {
updateFuzzyTimes();
document.querySelectorAll(".live-poll").forEach(node => {
var buttons = document.querySelectorAll(".live-poll");
if (buttons.length > 0) {
buttons.forEach(node => {
node.addEventListener("click", event => {
if (localStorage.sidekiqLivePoll == "enabled") {
localStorage.sidekiqLivePoll = "disabled";
@ -60,6 +62,7 @@ ready(() => {
if (localStorage.sidekiqLivePoll == "enabled") {
scheduleLivePoll();
}
}
})
function updateFuzzyTimes() {