浏览代码

use separate try_reconnect event to not do accidental reloading

Rodja Trappe 1 年之前
父节点
当前提交
37f966cae3
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      nicegui/templates/index.html

+ 2 - 0
nicegui/templates/index.html

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