summaryrefslogtreecommitdiffhomepage
path: root/app/components/Connect.js
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-08-01 14:21:58 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-08-08 15:26:34 +0200
commit2f6e76531419c0653212410dc992bf952ee5fbe5 (patch)
tree43e2eae17b1ae61da6a05a2e333b88cc6060b2ee /app/components/Connect.js
parent21c62239a0ef590e77f3a5a3448f36259755d6d8 (diff)
downloadmullvadvpn-2f6e76531419c0653212410dc992bf952ee5fbe5.tar.xz
mullvadvpn-2f6e76531419c0653212410dc992bf952ee5fbe5.zip
Pull account expiry on demand
Diffstat (limited to 'app/components/Connect.js')
-rw-r--r--app/components/Connect.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/app/components/Connect.js b/app/components/Connect.js
index 037ab02495..cd27b33719 100644
--- a/app/components/Connect.js
+++ b/app/components/Connect.js
@@ -15,7 +15,7 @@ import Map from './Map';
import type { HeaderBarStyle } from './HeaderBar';
import type { ConnectionReduxState } from '../redux/connection/reducers';
-export type ConnectProps = {
+type Props = {
connection: ConnectionReduxState,
accountExpiry: string,
selectedRelayName: string,
@@ -25,14 +25,15 @@ export type ConnectProps = {
onCopyIP: () => void,
onDisconnect: () => void,
onExternalLink: (type: string) => void,
+ updateAccountExpiry: () => Promise<void>,
};
-type ConnectState = {
+type State = {
showCopyIPMessage: boolean,
mapOffset: [number, number],
};
-export default class Connect extends Component<ConnectProps, ConnectState> {
+export default class Connect extends Component<Props, State> {
state = {
showCopyIPMessage: false,
mapOffset: [0, 0],
@@ -40,7 +41,7 @@ export default class Connect extends Component<ConnectProps, ConnectState> {
_copyTimer: ?TimeoutID;
- shouldComponentUpdate(nextProps: ConnectProps, nextState: ConnectState) {
+ shouldComponentUpdate(nextProps: Props, nextState: State) {
const { connection: prevConnection, ...otherPrevProps } = this.props;
const { connection: nextConnection, ...otherNextProps } = nextProps;
@@ -56,6 +57,10 @@ export default class Connect extends Component<ConnectProps, ConnectState> {
);
}
+ componentDidMount() {
+ this.props.updateAccountExpiry();
+ }
+
componentWillUnmount() {
if (this._copyTimer) {
clearTimeout(this._copyTimer);