diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2018-09-10 15:00:43 +0300 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2018-09-10 15:00:43 +0300 |
| commit | 91d3fe07688df60b435f934fce06e19a88560fb4 (patch) | |
| tree | b7d6ad37da84636a67554f2cbd88d0a1c8fdecce | |
| parent | bf3a84467d8972315dbdafa5b49d43780fafe8f7 (diff) | |
| parent | 8787cfb2f86a875ac5c29515c40b750e8d3a6004 (diff) | |
| download | mullvadvpn-91d3fe07688df60b435f934fce06e19a88560fb4.tar.xz mullvadvpn-91d3fe07688df60b435f934fce06e19a88560fb4.zip | |
Merge branch 'remove-unused-map-offset'
| -rw-r--r-- | gui/packages/desktop/src/renderer/components/Connect.js | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/gui/packages/desktop/src/renderer/components/Connect.js b/gui/packages/desktop/src/renderer/components/Connect.js index bf08000ce5..078883a23b 100644 --- a/gui/packages/desktop/src/renderer/components/Connect.js +++ b/gui/packages/desktop/src/renderer/components/Connect.js @@ -30,13 +30,11 @@ type Props = { type State = { showCopyIPMessage: boolean, - mapOffset: [number, number], }; export default class Connect extends Component<Props, State> { state = { showCopyIPMessage: false, - mapOffset: [0, 0], }; _copyTimer: ?TimeoutID; @@ -52,8 +50,6 @@ export default class Connect extends Component<Props, State> { // shallow compare the connection !shallowCompare(prevConnection, nextConnection) || !shallowCompare(otherPrevProps, otherNextProps) || - prevState.mapOffset[0] !== nextState.mapOffset[0] || - prevState.mapOffset[1] !== nextState.mapOffset[1] || prevState.showCopyIPMessage !== nextState.showCopyIPMessage ); } @@ -157,18 +153,6 @@ export default class Connect extends Component<Props, State> { } } - _updateMapOffset = (spinnerNode: ?HTMLElement) => { - if (spinnerNode) { - // calculate the vertical offset from the center of the map - // to shift the center of the map upwards to align the centers - // of spinner and marker on the map - const y = spinnerNode.offsetTop + spinnerNode.clientHeight * 0.5; - this.setState({ - mapOffset: [0, y], - }); - } - }; - renderMap() { let [isConnecting, isConnected, isDisconnected] = [false, false, false]; switch (this.props.connection.status) { @@ -194,13 +178,7 @@ export default class Connect extends Component<Props, State> { {/* show spinner when connecting */} {isConnecting ? ( <View style={styles.status_icon}> - <Img - source="icon-spinner" - height={60} - width={60} - alt="" - ref={this._updateMapOffset} - /> + <Img source="icon-spinner" height={60} width={60} alt="" /> </View> ) : null} |
