Skip to content

Commit

Permalink
Merge pull request #191 from Tiqr/feature/TIQR-502
Browse files Browse the repository at this point in the history
TIQR-502: Fix crash an aborting the account linking flow
  • Loading branch information
dzolnai authored Jan 23, 2025
2 parents 29cdaa0 + 4e07db6 commit d76a131
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/src/main/kotlin/nl/eduid/graphs/MainGraph.kt
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ fun MainGraph(
composable(Graph.FIRST_TIME_DIALOG) { entry ->
val viewModel = hiltViewModel<LinkAccountViewModel>(entry)
FirstTimeDialogRoute(viewModel = viewModel,
goToAccountLinked = { navController.goToWithPopCurrent(AccountLinked.routeWithRegistrationFlowParam(true)) },
skipThis = {
navController.navigate(Graph.HOME_PAGE) {
//Clear existing home page that has no account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ import nl.eduid.ui.theme.AlertWarningBackground
import nl.eduid.ui.theme.EduidAppAndroidTheme

@Composable
fun FirstTimeDialogRoute(viewModel: LinkAccountViewModel, goToAccountLinked: () -> Unit, skipThis: () -> Unit) {
fun FirstTimeDialogRoute(viewModel: LinkAccountViewModel, skipThis: () -> Unit) {
var isGettingLinkUrl by rememberSaveable { mutableStateOf(false) }
var isLinkingStarted by rememberSaveable { mutableStateOf(false) }
val launcher = rememberLauncherForActivityResult(contract = LinkAccountContract(), onResult = { _ ->
if (isLinkingStarted) {
goToAccountLinked()
// This part is called when the user came back to the app without linking anything
// (otherwise we would go via a deeplink to the success / error screen).
// In this case we do nothing. The user can choose to link again, or just press on the skip button.
isLinkingStarted = false
}
})
Expand Down

0 comments on commit d76a131

Please sign in to comment.