Skip to content

Commit

Permalink
Start at LoginDetails page if logging in via intent (#772)
Browse files Browse the repository at this point in the history
* Start at LoginDetails page if login via intent has data

* Ignore intent on re-creation
  • Loading branch information
sunkup committed May 2, 2024
1 parent aafcb2e commit 9c6c95a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ class LoginActivity @Inject constructor(): AppCompatActivity() {
super.onCreate(savedInstanceState)

// start with login info from Intent
model.updateLoginInfo(loginInfoFromIntent(intent))
if (savedInstanceState == null) {
val loginInfo = loginInfoFromIntent(intent)
if (loginInfo.baseUri != null) {
model.updateLoginInfo(loginInfo)
model.navToPage(LoginScreenModel.Page.LoginDetails)
}
}

setContent {
LoginScreen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class LoginScreenModel @Inject constructor(

// navigation events

fun navToPage(toPage: Page) {
page = toPage
}

fun navToNextPage() {
when (page) {
Page.LoginType -> {
Expand Down

0 comments on commit 9c6c95a

Please sign in to comment.