Skip to content

Commit

Permalink
Use already present reload function to reload page
Browse files Browse the repository at this point in the history
Fixes #1855
  • Loading branch information
mr-manuel committed Jan 27, 2025
1 parent 074ac78 commit f6617a1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/patches/index.html.patch
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@
qt: {
onLoaded: () => showUi(screen),
onExit: exitData =>
@@ -70,5 +99,22 @@
@@ -70,5 +99,24 @@
</script>
<script src="venus-gui-v2.js"></script>
<script type="text/javascript" src="qtloader.js"></script>
+ <script type="text/javascript">
+ var watchdogHit = false // this gets set to 'true' by a timer via BackendConnection::hitWatchdog()
+ var reloadTriggered = false // this gets set to 'true' if reload() is called to prevent multiple reload calls
+ console.log("starting watchdog timer")
+ setTimeout(function(){ // wait 2 minutes for the page to load, then set a 10 second watchdog timer
+ checkWatchdog()
Expand All @@ -76,9 +77,10 @@
+
+ function checkWatchdog()
+ {
+ if (!watchdogHit) {
+ if (!watchdogHit && !reloadTriggered) {
+ console.error("Watchdog timer expired - reloading page")
+ location.reload()
+ reload()
+ reloadTriggered = true
+ }
+ watchdogHit = false
+ }
Expand Down

0 comments on commit f6617a1

Please sign in to comment.