@@ -173,14 +173,17 @@ fun LoginView() {
173173 } else null
174174 }
175175
176- val bottomAppBar = viewModel.bottomAppBar ? : {
177- DefaultBottomAppBar (
178- backgroundColor = viewModel.dynamicBackgroundColor,
179- button = bioAuthButton ? : idpButton ? : customButton,
180- loading = viewModel.loading.value,
181- showButton = ! viewModel.authFinished.value,
182- )
183- }
176+ val bottomAppBarButton = bioAuthButton ? : idpButton ? : customButton
177+ val bottomAppBar = viewModel.bottomAppBar ? : bottomAppBarButton?.let { button ->
178+ {
179+ DefaultBottomAppBar (
180+ backgroundColor = viewModel.dynamicBackgroundColor,
181+ button = button,
182+ loading = viewModel.loading.value,
183+ showButton = ! viewModel.authFinished.value
184+ )
185+ }
186+ } ? : {}
184187
185188 LoginView (
186189 loginUrlData = viewModel.loginUrl,
@@ -505,25 +508,6 @@ private fun AppBarBackButtonPreview() {
505508 }
506509}
507510
508- @Preview
509- @Composable
510- private fun AppBarBackButtonLoadinPreview () {
511- val loginUrl = " https://login.salesforce.com"
512- val backgroundColor = Color (red = 244 , green = 246 , blue = 249 )
513- MaterialTheme (colorScheme = if (isSystemInDarkTheme()) sfDarkColors() else sfLightColors()) {
514- DefaultTopAppBar (
515- backgroundColor = backgroundColor,
516- titleText = loginUrl,
517- titleTextColor = Color .Black ,
518- showServerPicker = remember { mutableStateOf(false ) },
519- clearCookies = { },
520- reloadWebView = { },
521- shouldShowBackButton = true ,
522- finish = { },
523- )
524- }
525- }
526-
527511@Preview
528512@Composable
529513private fun AppBarDarkPreview () {
0 commit comments