Skip to content

Commit

Permalink
feat: toggle "body.htagoff" class when disconnected
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan authored Sep 14, 2023
1 parent 9349577 commit 3388316
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions htagweb/appserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ async def serve(self, request, obj ) -> HTMLResponse:
_WS_= new WebSocket("%(protocol)s://"+location.host+"/_/%(fqn)s"+location.search);
_WS_.onopen=function(evt) {
console.log("** WS connected")
document.body.classList.remove("htagoff");
retryms=500;
_WS_.onmessage = async function(e) {
Expand All @@ -285,6 +286,7 @@ async def serve(self, request, obj ) -> HTMLResponse:
_WS_.onclose = function(evt) {
console.log("** WS disconnected, retry in (ms):",retryms)
document.body.classList.add("htagoff");
setTimeout( function() {
connect();
retryms=retryms*2;
Expand Down

0 comments on commit 3388316

Please sign in to comment.