1
0
Fork 0

For #2719 - Fixes crash by registering to observer with a lifecycle owner

master
Jeff Boek 2019-05-21 21:42:42 -07:00
parent 851f066a2a
commit 5ec783f6e5
1 changed files with 2 additions and 2 deletions

View File

@ -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()
}
@ -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()
}