diff --git a/app/app/src/main/java/com/bringyour/network/ui/connect/ConnectActions.kt b/app/app/src/main/java/com/bringyour/network/ui/connect/ConnectActions.kt index dbe872d6..50eb3325 100644 --- a/app/app/src/main/java/com/bringyour/network/ui/connect/ConnectActions.kt +++ b/app/app/src/main/java/com/bringyour/network/ui/connect/ConnectActions.kt @@ -370,7 +370,7 @@ fun OpenProviderListButton( val text = if (selectedLocation == null || selectedLocation.connectLocationId.bestAvailable) { stringResource(id = R.string.best_available_provider) } else { - selectedLocation.name + selectedLocation.name.truncateClientId() } val iconTint = if (selectedLocation == null || selectedLocation.connectLocationId.bestAvailable) { @@ -449,6 +449,10 @@ fun OpenProviderListButton( } } +fun String.truncateClientId(): String { + return if (length > 12) "${take(4)}...${takeLast(4)}" else this +} + @Composable fun WindowTypeButtonText(windowType: WindowType) { val displayName = stringResource(