diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-11-22 09:56:12 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-11-24 16:26:28 +0100 |
| commit | 7cb83a297635c6f196b17d219e24f364eecd862f (patch) | |
| tree | d23fb82abcf3f9d9000c6d360761882c7bb16749 /gui/src/renderer/lib | |
| parent | 9b9065063733cc27d14ed0ab55b56333a265c4c7 (diff) | |
| download | mullvadvpn-7cb83a297635c6f196b17d219e24f364eecd862f.tar.xz mullvadvpn-7cb83a297635c6f196b17d219e24f364eecd862f.zip | |
Expand search results on first render after search
Diffstat (limited to 'gui/src/renderer/lib')
| -rw-r--r-- | gui/src/renderer/lib/filter-locations.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gui/src/renderer/lib/filter-locations.ts b/gui/src/renderer/lib/filter-locations.ts index 5352df41bd..91f219b9e5 100644 --- a/gui/src/renderer/lib/filter-locations.ts +++ b/gui/src/renderer/lib/filter-locations.ts @@ -89,6 +89,10 @@ export function searchForLocations( countries: Array<IRelayLocationRedux>, searchTerm: string, ): Array<IRelayLocationRedux> { + if (searchTerm === '') { + return countries; + } + return countries.reduce((countries, country) => { const matchingCities = searchCities(country.cities, searchTerm); const expanded = matchingCities.length > 0; |
