Retry websocket connect if error returned is 502

* Retry websocket connect if error returned is 502

* Introduce connect button on 'Disconnected' left-pane dialog

* NetworkStatus: If user clicks connect, show connecting for 5s
This commit is contained in:
Scott Nonnenberg 2020-03-20 11:01:55 -07:00
parent c44176f7f3
commit 6bd5587d50
5 changed files with 89 additions and 15 deletions

View file

@ -1,3 +1,6 @@
import { trigger } from '../../shims/events';
import { NoopActionType } from './noop';
import { LocalizerType } from '../../types/Util';
// State
@ -34,6 +37,7 @@ export type UserActionType = UserChangedActionType;
export const actions = {
userChanged,
manualReconnect,
};
function userChanged(attributes: {
@ -49,6 +53,15 @@ function userChanged(attributes: {
};
}
function manualReconnect(): NoopActionType {
trigger('manualConnect');
return {
type: 'NOOP',
payload: null,
};
}
// Reducer
function getEmptyState(): UserStateType {