From 860b306e8f47d249ebe4731c4f51a120b7a6b496 Mon Sep 17 00:00:00 2001 From: Evan Sarkar Date: Thu, 9 Apr 2026 07:40:16 +0530 Subject: [PATCH] truncate connect client id in ui --- .../java/com/bringyour/network/ui/connect/ConnectActions.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(