Skip to content

Commit

Permalink
For mozilla-mobile#6832 - Only emit session changes if fragment is at…
Browse files Browse the repository at this point in the history
…tached
  • Loading branch information
ekager committed May 21, 2020
1 parent 7feae98 commit e60d17b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged
import org.mozilla.fenix.BrowserDirection
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.addons.runIfFragmentIsAttached
import org.mozilla.fenix.browser.BrowserAnimator.Companion.getToolbarNavOptions
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
import org.mozilla.fenix.components.FenixSnackbar
Expand Down Expand Up @@ -829,7 +830,9 @@ class HomeFragment : Fragment() {
}

private fun emitSessionChanges() {
homeFragmentStore.dispatch(HomeFragmentAction.TabsChange(getListOfTabs()))
runIfFragmentIsAttached {
homeFragmentStore.dispatch(HomeFragmentAction.TabsChange(getListOfTabs()))
}
}

private fun getListOfSessions(): List<Session> {
Expand Down

0 comments on commit e60d17b

Please sign in to comment.