diff options
| author | anderklander <anderklander@gmail.com> | 2018-03-20 07:23:58 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-03-26 14:22:11 +0200 |
| commit | cd71e8a5ea8f45d4ed0831e3fb921fd489338bc1 (patch) | |
| tree | 4292fb85b0c7bc59b969b81051989118b6b45122 /app | |
| parent | 30b6dbe0caf3166ed4dd73e8c6c84289c2ea4892 (diff) | |
| download | mullvadvpn-cd71e8a5ea8f45d4ed0831e3fb921fd489338bc1.tar.xz mullvadvpn-cd71e8a5ea8f45d4ed0831e3fb921fd489338bc1.zip | |
fix flow issues
Diffstat (limited to 'app')
| -rw-r--r-- | app/components/Login.js | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/app/components/Login.js b/app/components/Login.js index 76e1bf1624..0326ede9f5 100644 --- a/app/components/Login.js +++ b/app/components/Login.js @@ -46,9 +46,9 @@ export default class Login extends Component<LoginPropTypes, State> { animatedDropdownValue: Animated.createValue(0), animatedLoginButtonValue: Animated.createValue(0), animation: null, - footerAnimationStyle: null, - dropdownAnimationStyle: null, - loginButtonAnimationStyle: null, + footerAnimationStyle: {}, + dropdownAnimationStyle: {}, + loginButtonAnimationStyle: {}, }; constructor(props: LoginPropTypes) { @@ -127,9 +127,11 @@ export default class Login extends Component<LoginPropTypes, State> { if (this.state.animation) { this.state.animation.stop(); } + const accountToken = this.props.account.accountToken; + const footerPosition = this._shouldShowFooter(props) ? 0 : this.state.footerHeight; const dropdownHeight = this._shouldShowAccountHistory(props) ? this.state.dropdownHeight : 0; - const loginButtonValue = (props.account.accountToken && props.account.accountToken.length) > 0 ? 1 : 0; + const loginButtonValue = (accountToken && accountToken.length) > 0 ? 1 : 0; this._setAnimation(this._getFooterAnimation(footerPosition), this._getDropdownAnimation(dropdownHeight), this._getLoginButtonAnimation(loginButtonValue)); } @@ -302,15 +304,6 @@ export default class Login extends Component<LoginPropTypes, State> { }); } - _getLoginArrowAnimation(toValue: number){ - return Animated.timing(this.state.animatedLoginArrowValue, { - toValue: toValue, - easing: Animated.Easing.Linear(), - duration: 250, - useNativeDriver: true, - }); - } - _onDropdownLayout = (layout) => { this.setState({dropdownHeight: layout.height}); } |
