mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-30 21:42:54 +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:
@@ -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