瀏覽代碼

simplified reload logic

Rodja Trappe 1 年之前
父節點
當前提交
e7eba13af6
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      nicegui/templates/index.html

+ 2 - 2
nicegui/templates/index.html

@@ -232,8 +232,8 @@
           window.socket.on("disconnect", () => {
             document.getElementById('popup').style.opacity = 1;
             const checkAndReload = async () => {
-              const response = await fetch(window.location.href);
-              if (response.ok || response.status == 404) window.location.reload();
+              await fetch(window.location.href);
+              window.location.reload();
             };
             setInterval(checkAndReload, 500);
           });