New: Warn if UI won't update due to SignalR errors

This commit is contained in:
ta264 2020-05-18 21:36:48 +01:00 committed by Qstick
parent 9c64ba6cbd
commit 4fd772f62b
4 changed files with 47 additions and 8 deletions

View file

@ -120,7 +120,7 @@ class SignalRConnector extends Component {
this.connection.on('receiveMessage', this.onReceiveMessage);
this.connection.start().then(this.onConnected);
this.connection.start().then(this.onStart, this.onStartFail);
}
componentWillUnmount() {
@ -296,7 +296,19 @@ class SignalRConnector extends Component {
//
// Listeners
onConnected = () => {
onStartFail = (error) => {
console.error('[signalR] failed to connect');
console.error(error);
this.props.dispatchSetAppValue({
isConnected: false,
isReconnecting: false,
isDisconnected: false,
isRestarting: false
});
}
onStart = () => {
console.debug('[signalR] connected');
this.props.dispatchSetAppValue({