Skip to content

Commit d309f31

Browse files
authored
android: don't show hex code yet (#536)
Hold off on showing the code until there is a place in the admin console for the user to input the code. Updates tailscale/tailscale#13277 Signed-off-by: kari-ts <[email protected]>
1 parent cd993fe commit d309f31

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

android/src/main/java/com/tailscale/ipn/ui/viewModel/LoginQRViewModel.kt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,26 @@ class LoginQRViewModel : IpnViewModel() {
2222

2323
val numCode: StateFlow<String?> = MutableStateFlow(null)
2424
val qrCode: StateFlow<ImageBitmap?> = MutableStateFlow(null)
25+
// Remove this once changes to admin console allowing input code to be entered are made.
26+
val codeEnabled = false
2527

2628
init {
2729
viewModelScope.launch {
2830
Notifier.browseToURL.collect { url ->
2931
url?.let {
3032
qrCode.set(generateQRCode(url, 200, 0))
31-
// Extract the string after "https://login.tailscale.com/a/"
32-
val prefix = "https://login.tailscale.com/a/"
33-
val code =
34-
if (it.startsWith(prefix)) {
35-
it.removePrefix(prefix)
36-
} else {
37-
null
38-
}
39-
numCode.set(code)
33+
34+
if (codeEnabled) {
35+
// Extract the string after "https://login.tailscale.com/a/"
36+
val prefix = "https://login.tailscale.com/a/"
37+
val code =
38+
if (it.startsWith(prefix)) {
39+
it.removePrefix(prefix)
40+
} else {
41+
null
42+
}
43+
numCode.set(code)
44+
}
4045
}
4146
?: run {
4247
qrCode.set(null)

0 commit comments

Comments
 (0)