summaryrefslogtreecommitdiffhomepage
path: root/app
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-06-20 16:20:04 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-06-20 16:20:04 +0200
commit648c6e06ce07503be4eebbd46bd7b2e843a862fe (patch)
treee8867916c95f8855dee60ad06f44e94244aa60f3 /app
parent3e7a83f27a10cf6630ba5ff885b64cc24b02e9e3 (diff)
parentffd34043d74cd59206c260b59d318c8e9bba9a39 (diff)
downloadmullvadvpn-648c6e06ce07503be4eebbd46bd7b2e843a862fe.tar.xz
mullvadvpn-648c6e06ce07503be4eebbd46bd7b2e843a862fe.zip
Merge branch 'migrate-to-chai-spies'
Diffstat (limited to 'app')
-rw-r--r--app/components/Connect.js4
-rw-r--r--app/lib/keyframe-animation.js4
-rw-r--r--app/routes.js10
3 files changed, 8 insertions, 10 deletions
diff --git a/app/components/Connect.js b/app/components/Connect.js
index f4647678f1..fbb743854d 100644
--- a/app/components/Connect.js
+++ b/app/components/Connect.js
@@ -294,7 +294,9 @@ export default class Connect extends Component<ConnectProps, ConnectState> {
}
onIPAddressClick() {
- this._copyTimer && clearTimeout(this._copyTimer);
+ if (this._copyTimer) {
+ clearTimeout(this._copyTimer);
+ }
this._copyTimer = setTimeout(() => this.setState({ showCopyIPMessage: false }), 3000);
this.setState({ showCopyIPMessage: true });
this.props.onCopyIP();
diff --git a/app/lib/keyframe-animation.js b/app/lib/keyframe-animation.js
index 1b52f859c6..7a8968eb35 100644
--- a/app/lib/keyframe-animation.js
+++ b/app/lib/keyframe-animation.js
@@ -36,7 +36,7 @@ export default class KeyframeAnimation {
this._onFrame = newValue;
}
get onFrame(): ?OnFrameFn {
- this._onFrame;
+ return this._onFrame;
}
// called when animation finished for non-repeating animations.
@@ -44,7 +44,7 @@ export default class KeyframeAnimation {
this._onFinish = newValue;
}
get onFinish(): ?OnFinishFn {
- this._onFinish;
+ return this._onFinish;
}
// pace per frame in ms
diff --git a/app/routes.js b/app/routes.js
index 03f3401035..c48e03dac3 100644
--- a/app/routes.js
+++ b/app/routes.js
@@ -21,10 +21,6 @@ export type SharedRouteProps = {
backend: Backend,
};
-type CustomRouteProps = {
- component: React.ComponentType<*>,
-};
-
export default function makeRoutes(
getState: ReduxGetState,
componentProps: SharedRouteProps,
@@ -40,7 +36,7 @@ export default function makeRoutes(
// Renders public route
// example: <PublicRoute path="/" component={ MyComponent } />
- const PublicRoute = ({ component, ...otherProps }: CustomRouteProps) => {
+ const PublicRoute = ({ component, ...otherProps }) => {
return (
// $FlowFixMe: This has been fixed in Flow 0.71
<Route
@@ -54,7 +50,7 @@ export default function makeRoutes(
// Renders protected route that requires authentication, otherwise redirects to /
// example: <PrivateRoute path="/protected" component={ MyComponent } />
- const PrivateRoute = ({ component, ...otherProps }: CustomRouteProps) => {
+ const PrivateRoute = ({ component, ...otherProps }) => {
return (
// $FlowFixMe: This has been fixed in Flow 0.71
<Route
@@ -76,7 +72,7 @@ export default function makeRoutes(
// Renders login route that is only available to non-authenticated
// users. Otherwise this route redirects user to /connect.
// example: <LoginRoute path="/login" component={ MyComponent } />
- const LoginRoute = ({ component, ...otherProps }: CustomRouteProps) => {
+ const LoginRoute = ({ component, ...otherProps }) => {
return (
// $FlowFixMe: This has been fixed in Flow 0.71
<Route