File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
android/src/main/java/com/tailscale/ipn/ui Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,15 @@ class Tailcfg {
188
188
data class Service (var Proto : String , var Port : Int , var Description : String? = null )
189
189
190
190
@Serializable
191
- data class NetworkProfile (var MagicDNSName : String? = null , var DomainName : String? = null )
191
+ data class NetworkProfile (
192
+ var MagicDNSName : String? = null ,
193
+ var DomainName : String? = null ,
194
+ var DisplayName : String? = null
195
+ ) {
196
+ fun tailnetNameForDisplay (): String? {
197
+ return DisplayName ? : DomainName
198
+ }
199
+ }
192
200
193
201
@Serializable
194
202
data class Location (
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ fun MainView(
167
167
}
168
168
},
169
169
headlineContent = {
170
- user?.NetworkProfile ?.DomainName ?.let { domain ->
170
+ user?.NetworkProfile ?.tailnetNameForDisplay() ?.let { domain ->
171
171
AutoResizingText (
172
172
text = domain,
173
173
style = MaterialTheme .typography.titleMedium.short,
@@ -500,7 +500,7 @@ fun ConnectView(
500
500
fontWeight = FontWeight .SemiBold ,
501
501
textAlign = TextAlign .Center ,
502
502
fontFamily = MaterialTheme .typography.titleMedium.fontFamily)
503
- val tailnetName = user.NetworkProfile ?.DomainName ? : " "
503
+ val tailnetName = user.NetworkProfile ?.tailnetNameForDisplay() ? : " "
504
504
Text (
505
505
buildAnnotatedString {
506
506
append(stringResource(id = R .string.connect_to_tailnet_prefix))
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ fun UserView(
63
63
supportingContent = {
64
64
Column {
65
65
AutoResizingText (
66
- text = profile.NetworkProfile ?.DomainName ? : " " ,
66
+ text = profile.NetworkProfile ?.tailnetNameForDisplay() ? : " " ,
67
67
style = MaterialTheme .typography.bodyMedium.short,
68
68
minFontSize = MaterialTheme .typography.minTextSize,
69
69
overflow = TextOverflow .Ellipsis )
You can’t perform that action at this time.
0 commit comments