Skip to content

Commit

Permalink
Remove the useless main function
Browse files Browse the repository at this point in the history
  • Loading branch information
leotaku committed Nov 30, 2024
1 parent 2a73bb7 commit 9371e5a
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions assets/polling.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@
.catch(() => setTimeout(() => retry(url), inputs.reloadInterval));
};

const main = () =>
fetch(inputs.longPoll, { cache: "no-store", signal: controller.signal })
.then((rsp) => rsp.text())
.catch(() => null)
.then(() => {
console.log("[tower-livereload] disconnected...");
if (!unloaded) retry(inputs.backUp);
});

console.log("[tower-livereload] connected...");
main();
fetch(inputs.longPoll, { cache: "no-store", signal: controller.signal })
.then((rsp) => rsp.text())
.catch(() => null)
.then(() => {
console.log("[tower-livereload] disconnected...");
if (!unloaded) retry(inputs.backUp);
});
})();

0 comments on commit 9371e5a

Please sign in to comment.