summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-08-03 15:25:16 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-08-08 16:25:34 +0200
commitb20780c2a7c549ae620182b524f5e82f017daf21 (patch)
tree7825f24f5b2510078d4ea390b60b77a0650fcc8a
parentf9b54901308bde3e1abeb0fa32d4a3f11648f603 (diff)
downloadmullvadvpn-b20780c2a7c549ae620182b524f5e82f017daf21.tar.xz
mullvadvpn-b20780c2a7c549ae620182b524f5e82f017daf21.zip
Refactor connection/actions
-rw-r--r--app/redux/connection/actions.js22
1 files changed, 12 insertions, 10 deletions
diff --git a/app/redux/connection/actions.js b/app/redux/connection/actions.js
index bb155aa485..915eedd273 100644
--- a/app/redux/connection/actions.js
+++ b/app/redux/connection/actions.js
@@ -4,21 +4,14 @@ import { Clipboard } from 'reactxp';
import type { ReduxThunk } from '../store';
import type { Ip } from '../../lib/daemon-rpc';
-const copyIPAddress = (): ReduxThunk => {
- return (_, getState) => {
- const ip = getState().connection.ip;
- if (ip) {
- Clipboard.setText(ip);
- }
- };
-};
-
type ConnectingAction = {
type: 'CONNECTING',
};
+
type ConnectedAction = {
type: 'CONNECTED',
};
+
type DisconnectedAction = {
type: 'DISCONNECTED',
};
@@ -88,12 +81,21 @@ function offline(): OfflineAction {
};
}
+function copyIPAddress(): ReduxThunk {
+ return (_, getState) => {
+ const ip = getState().connection.ip;
+ if (ip) {
+ Clipboard.setText(ip);
+ }
+ };
+}
+
export default {
- copyIPAddress,
newLocation,
connecting,
connected,
disconnected,
online,
offline,
+ copyIPAddress,
};