Skip to content

Commit 8debdc6

Browse files
committed
Fix konsist tests
1 parent 011b8ad commit 8debdc6

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/CustomListLocationsViewModel.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,10 @@ class CustomListLocationsViewModel(
232232
_expandedItems.value = initialExpands(selectedLocations)
233233
}
234234

235-
fun initialExpands(locations: Set<RelayItem.Location>): Set<RelayItemId> =
235+
private fun initialExpands(locations: Set<RelayItem.Location>): Set<RelayItemId> =
236236
locations.flatMap { it.id.ancestors() }.toSet()
237237

238-
companion object {
239-
private const val EMPTY_SEARCH_TERM = ""
240-
}
241-
242-
fun List<RelayItem.Location>.toRelayItems(
238+
private fun List<RelayItem.Location>.toRelayItems(
243239
isSelected: (RelayItem) -> Boolean,
244240
isExpanded: (RelayItemId) -> Boolean,
245241
depth: Int = 0,
@@ -279,6 +275,10 @@ class CustomListLocationsViewModel(
279275
}
280276
}
281277
}
278+
279+
companion object {
280+
private const val EMPTY_SEARCH_TERM = ""
281+
}
282282
}
283283

284284
sealed interface CustomListLocationsSideEffect {

android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/SelectLocationViewModel.kt

+9-9
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class SelectLocationViewModel(
104104
}
105105
}
106106

107-
fun searchRelayListLocations() =
107+
private fun searchRelayListLocations() =
108108
combine(
109109
_searchTerm,
110110
filteredRelayListUseCase(),
@@ -120,7 +120,7 @@ class SelectLocationViewModel(
120120
.onEach { _expandedItems.value = it.first }
121121
.map { it.second }
122122

123-
fun filterChips() =
123+
private fun filterChips() =
124124
combine(
125125
relayListFilterRepository.selectedOwnership,
126126
relayListFilterRepository.selectedProviders,
@@ -149,7 +149,7 @@ class SelectLocationViewModel(
149149
}
150150
}
151151

152-
fun relayListItems() =
152+
private fun relayListItems() =
153153
combine(
154154
_searchTerm,
155155
searchRelayListLocations(),
@@ -176,7 +176,7 @@ class SelectLocationViewModel(
176176
}
177177
}
178178

179-
fun createRelayListItems(
179+
private fun createRelayListItems(
180180
isSearching: Boolean,
181181
selectedItem: RelayItemId?,
182182
customLists: List<RelayItem.CustomList>,
@@ -186,7 +186,7 @@ class SelectLocationViewModel(
186186
createCustomListSection(isSearching, selectedItem, customLists, isExpanded) +
187187
createLocationSection(isSearching, selectedItem, countries, isExpanded)
188188

189-
fun createCustomListSection(
189+
private fun createCustomListSection(
190190
isSearching: Boolean,
191191
selectedItem: RelayItemId?,
192192
customLists: List<RelayItem.CustomList>,
@@ -202,7 +202,7 @@ class SelectLocationViewModel(
202202
}
203203
}
204204

205-
fun createCustomListRelayItems(
205+
private fun createCustomListRelayItems(
206206
customLists: List<RelayItem.CustomList>,
207207
selectedItem: RelayItemId?,
208208
isExpanded: (String) -> Boolean
@@ -228,7 +228,7 @@ class SelectLocationViewModel(
228228
}
229229
}
230230

231-
fun createLocationSection(
231+
private fun createLocationSection(
232232
isSearching: Boolean,
233233
selectedItem: RelayItemId?,
234234
countries: List<RelayItem.Location.Country>,
@@ -246,7 +246,7 @@ class SelectLocationViewModel(
246246
}
247247
}
248248

249-
fun createCustomListEntry(
249+
private fun createCustomListEntry(
250250
parent: CustomListId,
251251
item: RelayItem.Location,
252252
depth: Int = 1,
@@ -282,7 +282,7 @@ class SelectLocationViewModel(
282282
}
283283
}
284284

285-
fun createGeoLocationEntry(
285+
private fun createGeoLocationEntry(
286286
item: RelayItem.Location,
287287
selectedItem: RelayItemId?,
288288
depth: Int = 0,

0 commit comments

Comments
 (0)