fixing sync leak when changing to the profile page

This commit is contained in:
Adam Brown 2022-11-04 10:25:54 +00:00
parent a3dd5541e4
commit 5db1a87a38
1 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package app.dapk.st.home
import androidx.lifecycle.viewModelScope
import app.dapk.st.directory.state.ComponentLifecycle
import app.dapk.st.directory.state.DirectorySideEffect
import app.dapk.st.directory.state.DirectoryState
import app.dapk.st.domain.StoreCleaner
@ -122,7 +123,10 @@ internal class HomeViewModel(
// do nothing
}
Page.Profile -> profileViewModel.reset()
Page.Profile -> {
directoryState.dispatch(ComponentLifecycle.OnGone)
profileViewModel.reset()
}
}
}