Przeglądaj źródła

use separate try_reconnect event to not do accidental reloading

Rodja Trappe 1 rok temu
rodzic
commit
37f966cae3
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      nicegui/templates/index.html

+ 2 - 0
nicegui/templates/index.html

@@ -231,6 +231,8 @@
           });
           });
           window.socket.on("disconnect", () => {
           window.socket.on("disconnect", () => {
             document.getElementById('popup').style.opacity = 1;
             document.getElementById('popup').style.opacity = 1;
+          });
+          window.socket.on("try_reconnect", () => {
             const checkAndReload = async () => {
             const checkAndReload = async () => {
               await fetch(window.location.href);
               await fetch(window.location.href);
               window.location.reload();
               window.location.reload();