diff --git a/android/src/main/java/com/tailscale/ipn/ui/viewModel/LoginQRViewModel.kt b/android/src/main/java/com/tailscale/ipn/ui/viewModel/LoginQRViewModel.kt index 34d88dfd90..7499fc0c0f 100644 --- a/android/src/main/java/com/tailscale/ipn/ui/viewModel/LoginQRViewModel.kt +++ b/android/src/main/java/com/tailscale/ipn/ui/viewModel/LoginQRViewModel.kt @@ -22,21 +22,26 @@ class LoginQRViewModel : IpnViewModel() { val numCode: StateFlow = MutableStateFlow(null) val qrCode: StateFlow = MutableStateFlow(null) + // Remove this once changes to admin console allowing input code to be entered are made. + val codeEnabled = false init { viewModelScope.launch { Notifier.browseToURL.collect { url -> url?.let { qrCode.set(generateQRCode(url, 200, 0)) - // Extract the string after "https://login.tailscale.com/a/" - val prefix = "https://login.tailscale.com/a/" - val code = - if (it.startsWith(prefix)) { - it.removePrefix(prefix) - } else { - null - } - numCode.set(code) + + if (codeEnabled) { + // Extract the string after "https://login.tailscale.com/a/" + val prefix = "https://login.tailscale.com/a/" + val code = + if (it.startsWith(prefix)) { + it.removePrefix(prefix) + } else { + null + } + numCode.set(code) + } } ?: run { qrCode.set(null)