From 5db1a87a38ffd9cadac2e3d048b8931b0cb97b82 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 4 Nov 2022 10:25:54 +0000 Subject: [PATCH] fixing sync leak when changing to the profile page --- .../home/src/main/kotlin/app/dapk/st/home/HomeViewModel.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/features/home/src/main/kotlin/app/dapk/st/home/HomeViewModel.kt b/features/home/src/main/kotlin/app/dapk/st/home/HomeViewModel.kt index 0b6a277..7aa055f 100644 --- a/features/home/src/main/kotlin/app/dapk/st/home/HomeViewModel.kt +++ b/features/home/src/main/kotlin/app/dapk/st/home/HomeViewModel.kt @@ -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() + } } }