-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FC] Removes mavericks from repositories and more panes. #8154
[FC] Removes mavericks from repositories and more panes. #8154
Conversation
Diffuse output:
|
/** | ||
* The active auth session id. Used across process kills to prevent re-creating the session | ||
* if one is already active. | ||
*/ | ||
@PersistState | ||
val activeAuthSession: String? = null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
realized we don't need this anymore. When loading partner auth, we'd check the active session in the cached manifest, and if there's no manifest cached (i.e. process kill) we'd refetch it from backend, getting the existing auth session as well.
): Job { | ||
return viewModelScope.launch { | ||
setState { reducer(Loading) } | ||
setState { reducer(Loading(value = retainValue?.get(this)?.invoke())) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took this from mavericks: This allows us to optionally keep the current Async value if moving to a Loading state from Success (so that we can keep the screen content while loading)
|
||
suspend fun get() = awaitState().error | ||
private val state = MutableStateFlow(State()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a flow here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -180,7 +181,7 @@ internal class AccountPickerViewModel @Inject constructor( | |||
) | |||
} | |||
|
|||
fun onAccountClicked(account: PartnerAccount) = withState { state -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding a withState
method to our base ViewModel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6ca0025
into
carlosmuvi/i/remove-mavericks
* [FC] Moves Activities and some Panes out of Mavericks (#8125) * Removes mackericks references on Consent screen. * Updates files. * Uses viewmodel factory builder. * Updates functions. * Updates execute. * Updates compose util. * Adds missing side effects. * Simplifies code. * Renames viewmodel. * Updates async. * Removes mavericks from institution picker. * Reverts rename. * Updates baseline. * Adds setState and persists state. * Renames result error to fail. * Migrates Initial activity out of mavericks. * Removes persist state. * Updates tests. * Regenerates API. * filterNotNull. * Nits. * Updates async. * use suspend block. * Update financial-connections/src/main/java/com/stripe/android/financialconnections/core/FinancialConnectionsViewModel.kt Co-authored-by: Till Hellmund <tillh@stripe.com> * Tries onAsync. * Moves activity to stripe ui core. * PR feedback. * Regenerates deps. --------- Co-authored-by: Till Hellmund <tillh@stripe.com> * [FC] Removes mavericks from repositories and more panes. (#8154) * Migrates more screens out of mavs. * Migrates partner auth. * Removes active auth session field. * Updates tests. * Updates attach payment viewmodel. * PR feedback. * Api dump. * [FC] Removes mavericks from all viewmodels and tests (#8155) * Migrates more screens out of mavs. * Migrates partner auth. * Removes active auth session field. * Updates tests. * Updates attach payment viewmodel. * PR feedback. * Api dump. * Migrates missing viewmodels. * Updates dependencies. * PR feedback. * Merge master. * [FC] Removes mavericks dependency (#8160) * Migrates more screens out of mavs. * Migrates partner auth. * Removes active auth session field. * Updates tests. * Updates attach payment viewmodel. * PR feedback. * Api dump. * Migrates missing viewmodels. * Updates dependencies. * Removes mavericks dependency. * Merge with integration. * Uses collect. * Updates dependencies * Updates Changelog. * Update CHANGELOG.md Co-authored-by: Till Hellmund <tillh@stripe.com> --------- Co-authored-by: Till Hellmund <tillh@stripe.com>
Summary
Motivation
Testing