mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
Makes sure the accountViewModel is deleted when the user switches the screen, logs off or kills the activity.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user