chore(android): tidy up AuthViewModel (#10372)

- removes unused authFlowLaunched var
- store long authUrl in val
This commit is contained in:
Jamil
2025-09-17 23:39:10 -04:00
committed by GitHub
parent f2ff5dfeca
commit bfbdec1ea9

View File

@@ -20,8 +20,6 @@ internal class AuthViewModel
private val actionMutableLiveData = MutableLiveData<ViewAction>()
val actionLiveData: LiveData<ViewAction> = actionMutableLiveData
private var authFlowLaunched: Boolean = false
fun onActivityResume() =
viewModelScope.launch {
val state = generateRandomString(NONCE_LENGTH)
@@ -29,11 +27,10 @@ internal class AuthViewModel
repo.saveNonceSync(nonce)
repo.saveStateSync(state)
val config = repo.getConfigSync()
val authUrl = "${config.authUrl}/${config.accountSlug}?state=$state&nonce=$nonce&as=client"
actionMutableLiveData.postValue(
ViewAction.LaunchAuthFlow(
"${config.authUrl}/${config.accountSlug}?state=$state&nonce=$nonce&as=client",
),
ViewAction.LaunchAuthFlow(authUrl),
)
}