make profile tab switch instant when the data is already available

This commit is contained in:
Adam Brown 2022-11-04 11:34:55 +00:00
parent 4d853f0338
commit c6b9a997f3
1 changed files with 17 additions and 1 deletions

View File

@ -104,7 +104,23 @@ class ProfileViewModel(
} }
fun reset() { fun reset() {
updateState { ProfileScreenState(SpiderPage(Page.Routes.profile, "Profile", null, Page.Profile(Lce.Loading()), hasToolbar = false)) } when (state.page.state) {
is Page.Invitations -> updateState {
ProfileScreenState(
SpiderPage(
Page.Routes.profile,
"Profile",
null,
Page.Profile(Lce.Loading()),
hasToolbar = false
)
)
}
is Page.Profile -> {
// do nothing
}
}
} }
fun stop() { fun stop() {