diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2017-11-22 11:25:54 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2017-11-23 12:41:13 +0100 |
| commit | e7782654f1ffc7268dd6295096bc9c7857cd3ec9 (patch) | |
| tree | eb1a829046a88277414376b3fca30dcc33c2915a | |
| parent | 6311cfea6ca8546c8ad854debd2cad785cd5eca3 (diff) | |
| download | mullvadvpn-e7782654f1ffc7268dd6295096bc9c7857cd3ec9.tar.xz mullvadvpn-e7782654f1ffc7268dd6295096bc9c7857cd3ec9.zip | |
Inline onConnecting
| -rw-r--r-- | app/redux/connection/reducers.js | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/app/redux/connection/reducers.js b/app/redux/connection/reducers.js index ce4cb79344..48177fc5b6 100644 --- a/app/redux/connection/reducers.js +++ b/app/redux/connection/reducers.js @@ -38,7 +38,7 @@ export default function(state: ConnectionReduxState = initialState, action: Redu return { ...state, ...action.newLocation }; case 'CONNECTING': - return onConnecting(state, action); + return { ...state, ...{ status: 'connecting', serverAddress: action.host }}; case 'CONNECTED': return { ...state, ...{ status: 'connected' }}; @@ -56,14 +56,3 @@ export default function(state: ConnectionReduxState = initialState, action: Redu return state; } } - -function onConnecting(state, action) { - const newState: $Shape<ConnectionReduxState> = { - status: 'connecting', - }; - - if (action.host) { - newState.serverAddress = action.host; - } - return { ...state, ...newState}; -} |
