mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 09:56:00 +03:00
Kotlin style
This commit is contained in:
parent
0f7a56d005
commit
45f7d3e9c4
1 changed files with 4 additions and 10 deletions
|
@ -50,16 +50,10 @@ internal class SessionManager @Inject constructor(private val matrixComponent: M
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getOrCreateSessionComponent(sessionParams: SessionParams): SessionComponent {
|
private fun getOrCreateSessionComponent(sessionParams: SessionParams): SessionComponent {
|
||||||
val userId = sessionParams.credentials.userId
|
return sessionComponents.getOrPut(sessionParams.credentials.userId) {
|
||||||
if (sessionComponents.containsKey(userId)) {
|
DaggerSessionComponent
|
||||||
return sessionComponents[userId]!!
|
.factory()
|
||||||
|
.create(matrixComponent, sessionParams)
|
||||||
}
|
}
|
||||||
return DaggerSessionComponent
|
|
||||||
.factory()
|
|
||||||
.create(matrixComponent, sessionParams)
|
|
||||||
.also {
|
|
||||||
sessionComponents[userId] = it
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue