NTP-3507 | Calling updateLinkedAccount from screen launch instead of VM init (#12789)

This commit is contained in:
vedant aggarwal
2024-09-26 18:04:07 +05:30
committed by GitHub
parent 8d4244f26c
commit 679573f5ff
2 changed files with 2 additions and 5 deletions

View File

@@ -144,6 +144,7 @@ fun LinkedAccountDetailScreen(
naviPayAnalytics: NaviPayAnalytics.NaviPayAccountDetails =
NaviPayAnalytics.INSTANCE.NaviPayAccountDetails(),
) {
LaunchedEffect(Unit) { linkedAccountDetailViewModel.updateLinkedAccount() }
val scope = rememberCoroutineScope()
val linkedAccountDetailScreenState by
linkedAccountDetailViewModel.linkedAccountDetailScreenState.collectAsStateWithLifecycle()

View File

@@ -176,11 +176,7 @@ constructor(
var actionBeforeOnboardingSdkTrigger: LinkedAccountDetailClickedAction? = null
init {
updateLinkedAccount()
}
private fun updateLinkedAccount() {
fun updateLinkedAccount() {
viewModelScope.launch(Dispatchers.IO) {
val linkedAccounts = linkedAccountsUseCase.execute().first()