Makes sure the tryLogin function only runs if it is not already logged in (compostables might call it more times)

This commit is contained in:
Vitor Pamplona
2025-04-01 18:58:15 -04:00
parent d08998736f
commit 1bd32c854c
@@ -85,7 +85,11 @@ class AccountStateViewModel : ViewModel() {
fun tryLoginExistingAccountAsync() { fun tryLoginExistingAccountAsync() {
// pulls account from storage. // pulls account from storage.
viewModelScope.launch { tryLoginExistingAccount() } if (_accountContent.value !is AccountState.LoggedIn) {
viewModelScope.launch {
tryLoginExistingAccount()
}
}
} }
private suspend fun tryLoginExistingAccount(route: String? = null) = private suspend fun tryLoginExistingAccount(route: String? = null) =