Fix image not rendering after clearing cache.
This commit is contained in:
parent
0cf5a41c61
commit
775cb89993
3 changed files with 17 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ import javax.inject.Provider
|
|||
|
||||
interface ImageLoaderHolder {
|
||||
fun get(client: MatrixClient): ImageLoader
|
||||
fun remove(sessionId: SessionId)
|
||||
}
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
|
|
@ -52,7 +53,7 @@ class DefaultImageLoaderHolder @Inject constructor(
|
|||
override suspend fun onSessionCreated(userId: String) = Unit
|
||||
|
||||
override suspend fun onSessionDeleted(userId: String) {
|
||||
map.remove(SessionId(userId))
|
||||
remove(SessionId(userId))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -68,4 +69,10 @@ class DefaultImageLoaderHolder @Inject constructor(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun remove(sessionId: SessionId) {
|
||||
synchronized(map) {
|
||||
map.remove(sessionId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue