Skip to content

Commit

Permalink
Fixed login screen to show loading indicator for successive logins.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob3075 committed May 13, 2023
1 parent 8982f78 commit 31dc884
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ fun LoginPageScreen(
val snackBarCoroutineScope = rememberCoroutineScope()
LaunchedEffect(viewState) {
when (val viewStateInstance = viewState) {
is LoginPageState.Success -> {
loginPageNavigator.toHomePage()
}
is LoginPageState.Success -> loginPageNavigator.toHomePage()

is LoginPageState.Error -> showSnackBar(
viewStateInstance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class LoginPageViewModel @Inject constructor(
* token is available
*/
private fun updateUserDetails() {
_viewState.value = LoginPageState.Loading
viewModelScope.launch {
_viewState.value = authTokenProvider.getFreshToken()
.filterNotNull()
Expand Down

0 comments on commit 31dc884

Please sign in to comment.