Skip to content

Commit a9c2137

Browse files
feat(overmind-devtools): show error when disconnected and then restart
1 parent 88b7952 commit a9c2137

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/node_modules/overmind-devtools-client/src/BackendConnector.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class WebsocketConnector {
1818
private schedulePing () {
1919
setTimeout(() => {
2020
this.send('ping')
21-
}, 1000 * 30)
21+
}, 1000 * 10)
2222
}
2323
public connect(
2424
port: string | number // TODO: return Promise so we can wait for it
@@ -49,6 +49,12 @@ class WebsocketConnector {
4949
}
5050
this.socket.onclose = (reason) => {
5151
console.log("Socket closed", reason)
52+
alert("The client lost connection to the backend, we have no idea why. Please report this if it occurs. We will now restart the application")
53+
// @ts-ignore
54+
if (window.onRestart) {
55+
// @ts-ignore
56+
window.onRestart()
57+
}
5258
}
5359
})
5460
}

0 commit comments

Comments
 (0)