Use LRU to cache the Avatar shown in push notifications (#7124)

* iOS switch from file cache to memory cache and use last_picture_update to update the avatar if needed

* Android switch from file cache to memory cache and use last_picture_update to update the avatar if needed, split function to multiple files and catch potential exceptions
This commit is contained in:
Elias Nahum
2023-02-15 11:19:31 +02:00
committed by GitHub
parent ab5084ce48
commit 23cbf82353
40 changed files with 1919 additions and 1042 deletions

View File

@@ -29,11 +29,10 @@ class SplitViewModule(private var reactContext: ReactApplicationContext) : React
override fun getName() = "SplitView"
fun sendEvent(eventName: String,
params: WritableMap?) {
private fun sendEvent(params: WritableMap?) {
reactContext
.getJSModule(RCTDeviceEventEmitter::class.java)
.emit(eventName, params)
.emit("SplitViewChanged", params)
}
private fun getSplitViewResults(folded: Boolean) : WritableMap? {
@@ -51,7 +50,7 @@ class SplitViewModule(private var reactContext: ReactApplicationContext) : React
fun setDeviceFolded(folded: Boolean) {
val map = getSplitViewResults(folded)
if (listenerCount > 0 && isDeviceFolded != folded) {
sendEvent("SplitViewChanged", map)
sendEvent(map)
}
isDeviceFolded = folded
}