summaryrefslogtreecommitdiffhomepage
path: root/android/app/src/main
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-09-30 15:41:10 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-10-01 08:59:39 +0200
commite5e5ddce0b0e83da75e6e47aa63999ad8eb96f05 (patch)
treeb443eefd7ef4733824d4d70c7aa2bec8b959f4fb /android/app/src/main
parent7a29bd5ff6214ecde832539942e02f6dde22b15f (diff)
downloadmullvadvpn-e5e5ddce0b0e83da75e6e47aa63999ad8eb96f05.tar.xz
mullvadvpn-e5e5ddce0b0e83da75e6e47aa63999ad8eb96f05.zip
Sort custom lists alphabetically
Diffstat (limited to 'android/app/src/main')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/repository/CustomListsRepository.kt5
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 })
}