Move all status/alert dialogs into the Left Pane
This commit is contained in:
parent
101070bf42
commit
18fd44f504
50 changed files with 1298 additions and 607 deletions
21
ts/state/selectors/network.ts
Normal file
21
ts/state/selectors/network.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { createSelector } from 'reselect';
|
||||
|
||||
import { StateType } from '../reducer';
|
||||
import { NetworkStateType } from '../ducks/network';
|
||||
import { isDone } from './registration';
|
||||
|
||||
const getNetwork = (state: StateType): NetworkStateType => state.network;
|
||||
|
||||
export const hasNetworkDialog = createSelector(
|
||||
getNetwork,
|
||||
isDone,
|
||||
(
|
||||
{ isOnline, socketStatus, withinConnectingGracePeriod }: NetworkStateType,
|
||||
isRegistrationDone: boolean
|
||||
): boolean =>
|
||||
!isOnline ||
|
||||
!isRegistrationDone ||
|
||||
(socketStatus === WebSocket.CONNECTING && !withinConnectingGracePeriod) ||
|
||||
socketStatus === WebSocket.CLOSED ||
|
||||
socketStatus === WebSocket.CLOSING
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue