diff options
Diffstat (limited to 'android/app/src/main')
| -rw-r--r-- | android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt index 06d74eed3f..c7d2ee3414 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt @@ -26,7 +26,7 @@ class CustomListsRepository( ) { val customLists: StateFlow<List<CustomList>?> = managementService.settings - .mapNotNull { it.customLists } + .mapNotNull { it.customLists.sortedByName() } .stateIn(CoroutineScope(dispatcher), SharingStarted.Eagerly, null) suspend fun createCustomList( @@ -75,4 +75,7 @@ class CustomListsRepository( GetCustomListError(id) } } + + private fun List<CustomList>.sortedByName() = + this.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.name.value }) } |
