Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
For #2719 - Fixes crash by registering to observer with a lifecycle o…
Browse files Browse the repository at this point in the history
…wner
  • Loading branch information
boek committed May 22, 2019
1 parent 851f066 commit 5ec783f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class HomeFragment : Fragment(), CoroutineScope {
val observer = object : SessionManager.Observer {
override fun onSessionAdded(session: Session) {
super.onSessionAdded(session)
session.register(singleSessionObserver)
session.register(singleSessionObserver, this@HomeFragment)
emitSessionChanges()
}

Expand All @@ -476,7 +476,7 @@ class HomeFragment : Fragment(), CoroutineScope {
override fun onSessionsRestored() {
super.onSessionsRestored()
requireComponents.core.sessionManager.sessions.forEach {
it.register(singleSessionObserver)
it.register(singleSessionObserver, this@HomeFragment)
}
emitSessionChanges()
}
Expand Down

0 comments on commit 5ec783f

Please sign in to comment.