android: only navigate to main if navController is initialized

Updates #cleanup

Signed-off-by: Percy Wegmann <percy@tailscale.com>
(cherry picked from commit 698fb868a7)
release-branch/1.66
Percy Wegmann 2 years ago committed by Andrea Gottardo
parent 5860601c6d
commit 01d939d0c7

@ -265,9 +265,11 @@ class MainActivity : ComponentActivity() {
override fun onNewIntent(intent: Intent?) { override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent) super.onNewIntent(intent)
if (intent?.getBooleanExtra(START_AT_ROOT, false) == true) { if (intent?.getBooleanExtra(START_AT_ROOT, false) == true) {
if (this::navController.isInitialized) {
navController.popBackStack(route = "main", inclusive = false) navController.popBackStack(route = "main", inclusive = false)
} }
} }
}
private fun login(urlString: String) { private fun login(urlString: String) {
// Launch coroutine to listen for state changes. When the user completes login, relaunch // Launch coroutine to listen for state changes. When the user completes login, relaunch

Loading…
Cancel
Save