Fix back arrow behavior for remote-only sign-in flow
It should lead back to the snackbar. Currently it cancels the whole flow. Bug: 280517963 Test: manual (see bug for recording) Change-Id: Ibd4993dbca888c0c9f012963f54623cc426571ae
This commit is contained in:
@@ -232,6 +232,14 @@ class CredentialSelectorViewModel(
|
||||
)
|
||||
}
|
||||
|
||||
fun getFlowOnBackToHybridSnackBarScreen() {
|
||||
uiState = uiState.copy(
|
||||
getCredentialUiState = uiState.getCredentialUiState?.copy(
|
||||
currentScreenState = GetScreenState.REMOTE_ONLY
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
fun getFlowOnBackToPrimarySelectionScreen() {
|
||||
uiState = uiState.copy(
|
||||
getCredentialUiState = uiState.getCredentialUiState?.copy(
|
||||
|
||||
@@ -121,9 +121,10 @@ fun GetCredentialScreen(
|
||||
providerDisplayInfo = getCredentialUiState.providerDisplayInfo,
|
||||
onEntrySelected = viewModel::getFlowOnEntrySelected,
|
||||
onBackButtonClicked =
|
||||
viewModel::getFlowOnBackToPrimarySelectionScreen,
|
||||
if (getCredentialUiState.isNoAccount)
|
||||
viewModel::getFlowOnBackToHybridSnackBarScreen
|
||||
else viewModel::getFlowOnBackToPrimarySelectionScreen,
|
||||
onCancel = viewModel::onUserCancel,
|
||||
isNoAccount = getCredentialUiState.isNoAccount,
|
||||
onLog = { viewModel.logUiEvent(it) },
|
||||
)
|
||||
viewModel.uiMetrics.log(GetCredentialEvent
|
||||
@@ -327,7 +328,6 @@ fun AllSignInOptionCard(
|
||||
onEntrySelected: (BaseEntry) -> Unit,
|
||||
onBackButtonClicked: () -> Unit,
|
||||
onCancel: () -> Unit,
|
||||
isNoAccount: Boolean,
|
||||
onLog: @Composable (UiEventEnum) -> Unit,
|
||||
) {
|
||||
val sortedUserNameToCredentialEntryList =
|
||||
@@ -336,7 +336,7 @@ fun AllSignInOptionCard(
|
||||
SheetContainerCard(topAppBar = {
|
||||
MoreOptionTopAppBar(
|
||||
text = stringResource(R.string.get_dialog_title_sign_in_options),
|
||||
onNavigationIconClicked = if (isNoAccount) onCancel else onBackButtonClicked,
|
||||
onNavigationIconClicked = onBackButtonClicked,
|
||||
bottomPadding = 0.dp,
|
||||
)
|
||||
}) {
|
||||
|
||||
Reference in New Issue
Block a user