mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-01 00:18:30 +02:00
Makes sure the accountViewModel is deleted when the user switches the screen, logs off or kills the activity.
This commit is contained in:
parent
7b8c7a1a78
commit
4b249156f9
@ -102,6 +102,12 @@ fun AccountScreen(
|
||||
sharedPreferencesViewModel,
|
||||
)
|
||||
}
|
||||
|
||||
DisposableEffect(key1 = accountState) {
|
||||
onDispose {
|
||||
state.currentViewModelStore.viewModelStore.clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
is AccountState.LoggedInViewOnly -> {
|
||||
CompositionLocalProvider(
|
||||
@ -113,6 +119,12 @@ fun AccountScreen(
|
||||
sharedPreferencesViewModel,
|
||||
)
|
||||
}
|
||||
|
||||
DisposableEffect(key1 = accountState) {
|
||||
onDispose {
|
||||
state.currentViewModelStore.viewModelStore.clear()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user