summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-09-06 09:25:12 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2018-09-06 09:25:12 -0300
commit931265d2da0eed4962981f40b65d06cf7ce5b75e (patch)
tree9c7b445d4d9ccf397de1579e97f86aa107149a1b
parentd051e71ae289a92be1743a6b844d290cbfae4fd9 (diff)
parent938d7b72bc5c2d551f8cc396fc74a853b9171ab2 (diff)
downloadmullvadvpn-931265d2da0eed4962981f40b65d06cf7ce5b75e.tar.xz
mullvadvpn-931265d2da0eed4962981f40b65d06cf7ce5b75e.zip
Merge branch 'fix-select-servers-in-sole-city-of-a-country'
-rw-r--r--gui/packages/desktop/src/renderer/components/SelectLocation.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/gui/packages/desktop/src/renderer/components/SelectLocation.js b/gui/packages/desktop/src/renderer/components/SelectLocation.js
index ee1bb13c2c..e9c9852ec2 100644
--- a/gui/packages/desktop/src/renderer/components/SelectLocation.js
+++ b/gui/packages/desktop/src/renderer/components/SelectLocation.js
@@ -182,6 +182,10 @@ export default class SelectLocation extends React.Component<SelectLocationProps,
// either expanded by user or when the city selected within the country
const isExpanded = this.state.expanded.includes(relayCountry.code);
+ const hasChildren =
+ relayCountry.cities.length > 1 ||
+ (relayCountry.cities.length == 1 && relayCountry.cities[0].relays.length > 1);
+
const handleSelect =
relayCountry.hasActiveRelays && !isSelected
? () => {
@@ -207,7 +211,7 @@ export default class SelectLocation extends React.Component<SelectLocationProps,
<Cell.Label>{relayCountry.name}</Cell.Label>
- {relayCountry.cities.length > 1 ? (
+ {hasChildren ? (
<Cell.Img
style={styles.collapse_button}
hoverStyle={styles.expand_chevron_hover}
@@ -219,7 +223,7 @@ export default class SelectLocation extends React.Component<SelectLocationProps,
) : null}
</Cell.CellButton>
- {relayCountry.cities.length > 1 && (
+ {hasChildren && (
<Accordion height={isExpanded ? 'auto' : 0}>
{relayCountry.cities.map((relayCity) => this._renderCity(relayCountry.code, relayCity))}
</Accordion>