mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-06-25 01:00:53 +02:00
Recreates the viewModel when the Account object changes.
This commit is contained in:
parent
d3d2845f10
commit
f072b98fd7
@ -41,7 +41,7 @@ fun AccountScreen(
|
|||||||
}
|
}
|
||||||
is AccountState.LoggedIn -> {
|
is AccountState.LoggedIn -> {
|
||||||
val accountViewModel: AccountViewModel = viewModel(
|
val accountViewModel: AccountViewModel = viewModel(
|
||||||
key = state.account.userProfile().pubkeyHex,
|
key = state.account.hashCode().toString(),
|
||||||
factory = AccountViewModel.Factory(state.account, sharedPreferencesViewModel.sharedPrefs)
|
factory = AccountViewModel.Factory(state.account, sharedPreferencesViewModel.sharedPrefs)
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ fun AccountScreen(
|
|||||||
}
|
}
|
||||||
is AccountState.LoggedInViewOnly -> {
|
is AccountState.LoggedInViewOnly -> {
|
||||||
val accountViewModel: AccountViewModel = viewModel(
|
val accountViewModel: AccountViewModel = viewModel(
|
||||||
key = state.account.userProfile().pubkeyHex,
|
key = state.account.hashCode().toString(),
|
||||||
factory = AccountViewModel.Factory(state.account, sharedPreferencesViewModel.sharedPrefs)
|
factory = AccountViewModel.Factory(state.account, sharedPreferencesViewModel.sharedPrefs)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user