소스 검색

improve reconnect when accessing via On Air

Rodja Trappe 1 년 전
부모
커밋
2bfd7f5663
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      nicegui/templates/index.html

+ 2 - 4
nicegui/templates/index.html

@@ -272,13 +272,11 @@
                 window.location.reload(); // see https://github.com/zauberzeug/nicegui/issues/198
               }
             },
-            try_reconnect: () => {
-              const checkAndReload = async () => {
+            try_reconnect: async () => {
+                document.getElementById('popup').style.opacity = 1;
                 await fetch(window.location.href, { headers: { 'NiceGUI-Check': 'try_reconnect' } });
                 console.log('reloading because reconnect was requested')
                 window.location.reload();
-              };
-              setInterval(checkAndReload, 500);
             },
             disconnect: () => {
               document.getElementById('popup').style.opacity = 1;