 continue"
    );
    if (prompt.toLowerCase() === "ok") {
      $.get(this.href)
    }
  });

  socket.on("queue_update", getQueue);

  //on page load
  $(function () {
    //first time load
    getQueue();

    document.addEventListener("visibilitychange", function() {
      if (document.visibilityState === 'visible') {
        getQueue();
        if (!socket.connected) {
            console.log('Reconnecting socket...');
            connectSocket();
        }
      }
    });
  });
</script>

{% endblock 