diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-07-16 20:54:39 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-07-16 20:54:39 +0200 |
| commit | 508fc0775e62f9361df2814cad5229b7706d4095 (patch) | |
| tree | 055ad745e22cb3b1cbbe91571d57a08070d4a525 /app/components | |
| parent | 8e219adbcc3523badf5a0351ca4a8e91596b4114 (diff) | |
| parent | 313d3bf47cd3cc91bc34143deaa930d4bbea14ce (diff) | |
| download | mullvadvpn-508fc0775e62f9361df2814cad5229b7706d4095.tar.xz mullvadvpn-508fc0775e62f9361df2814cad5229b7706d4095.zip | |
Merge branch 'add-eslint-promises'
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/Accordion.js | 10 | ||||
| -rw-r--r-- | app/components/TransitionContainerStyles.android.js | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/app/components/Accordion.js b/app/components/Accordion.js index f69389f6c7..8197fd0e61 100644 --- a/app/components/Accordion.js +++ b/app/components/Accordion.js @@ -2,6 +2,7 @@ import * as React from 'react'; import { Component, View, Styles, Animated, UserInterface } from 'reactxp'; +import { log } from '../lib/platform'; export type AccordionProps = { height: number | 'auto', @@ -89,7 +90,7 @@ export default class Accordion extends Component<AccordionProps, AccordionState> ); } - _animateHeightChanges() { + async _animateHeightChanges() { const containerView = this._containerView; if (!containerView) { return; @@ -100,7 +101,8 @@ export default class Accordion extends Component<AccordionProps, AccordionState> this._animation = null; } - UserInterface.measureLayoutRelativeToWindow(containerView).then((layout) => { + try { + const layout = await UserInterface.measureLayoutRelativeToWindow(containerView); const fromValue = this.state.animatedValue || Animated.createValue(layout.height); const toValue = this.props.height === 'auto' ? this._contentHeight : this.props.height; @@ -119,7 +121,9 @@ export default class Accordion extends Component<AccordionProps, AccordionState> this.setState({ animatedValue: fromValue }, () => { animation.start(this._onAnimationEnd); }); - }); + } catch (error) { + log.error(`Failed to measure the layout of Accordion: ${error.message}`); + } } _onAnimationEnd = ({ finished }) => { diff --git a/app/components/TransitionContainerStyles.android.js b/app/components/TransitionContainerStyles.android.js index b234ff4be0..c894d9fb01 100644 --- a/app/components/TransitionContainerStyles.android.js +++ b/app/components/TransitionContainerStyles.android.js @@ -9,6 +9,7 @@ let menuBarHeight; MobileAppBridge.getMenuBarHeight() .then((_response) => { menuBarHeight = _response; + return; }) .catch((e) => { log.error('Failed getting menuBarHeight:', e); |
