summaryrefslogtreecommitdiffhomepage
path: root/app/components/Connect.js
diff options
context:
space:
mode:
authorErik Larkö <erik@mullvad.net>2017-07-05 22:22:26 +0200
committerErik Larkö <erik@mullvad.net>2017-07-06 11:07:04 +0200
commitec9e009405c655a7139ee2867f4971be87f88fef (patch)
treebd93f0b36094cc8b68a4cf1e3b0b136e3f114944 /app/components/Connect.js
parent9ffcd12913f093e218996dd06e5e7513f2d12e07 (diff)
downloadmullvadvpn-ec9e009405c655a7139ee2867f4971be87f88fef.tar.xz
mullvadvpn-ec9e009405c655a7139ee2867f4971be87f88fef.zip
Don't crash on the map on Linux
Diffstat (limited to 'app/components/Connect.js')
-rw-r--r--app/components/Connect.js49
1 files changed, 26 insertions, 23 deletions
diff --git a/app/components/Connect.js b/app/components/Connect.js
index 602ac5299e..8d5893c0a5 100644
--- a/app/components/Connect.js
+++ b/app/components/Connect.js
@@ -125,32 +125,35 @@ export default class Connect extends Component {
const accountLocation = this.convertToMapCoordinate(this.props.account.location || [0, 0]);
const serverLocation = this.convertToMapCoordinate(serverInfo.location);
+ const map = process.platform === 'darwin'
+ ? <ReactMapboxGl
+ style={ mapboxConfig.styleURL }
+ accessToken={ mapboxConfig.accessToken }
+ containerStyle={{ height: '100%' }}
+ interactive={ false }
+ fitBounds={ mapBounds }
+ fitBoundsOptions={ mapBoundsOptions }>
+ <If condition={ isConnected }>
+ <Then>
+ <Marker coordinates={ serverLocation } offset={ [0, -10] }>
+ <img src='./assets/images/location-marker-secure.svg' />
+ </Marker>
+ </Then>
+ </If>
+ <If condition={ !isConnected }>
+ <Then>
+ <Marker coordinates={ accountLocation } offset={ [0, -10] }>
+ <img src='./assets/images/location-marker-unsecure.svg' />
+ </Marker>
+ </Then>
+ </If>
+ </ReactMapboxGl>
+ : undefined;
+
return (
<div className="connect">
<div className="connect__map">
- <ReactMapboxGl
- style={ mapboxConfig.styleURL }
- accessToken={ mapboxConfig.accessToken }
- containerStyle={{ height: '100%' }}
- interactive={ false }
- fitBounds={ mapBounds }
- fitBoundsOptions={ mapBoundsOptions }>
- <If condition={ isConnected }>
- <Then>
- <Marker coordinates={ serverLocation } offset={ [0, -10] }>
- <img src='./assets/images/location-marker-secure.svg' />
- </Marker>
- </Then>
- </If>
- <If condition={ !isConnected }>
- <Then>
- <Marker coordinates={ accountLocation } offset={ [0, -10] }>
- <img src='./assets/images/location-marker-unsecure.svg' />
- </Marker>
- </Then>
- </If>
-
- </ReactMapboxGl>
+ { map }
</div>
<div className="connect__container">