Pruning file storage events when pausing the app.

This commit is contained in:
Vitor Pamplona 2023-04-27 09:26:26 -04:00
parent d4a3ee2651
commit 1596a7b559
2 changed files with 6 additions and 1 deletions

View File

@ -72,6 +72,7 @@ object ServiceManager {
LocalCache.pruneOldAndHiddenMessages(it)
LocalCache.pruneHiddenMessages(it)
LocalCache.pruneContactLists(it)
LocalCache.pruneFileStorageEvents(it)
// LocalCache.pruneNonFollows(it)
}
}

View File

@ -750,7 +750,11 @@ object LocalCache {
}
fun pruneFileStorageEvents(account: Account) {
notes.filter { it.value.event is FileStorageEvent }
val toBeRemoved = notes.filter { it.value.event is FileStorageEvent }
toBeRemoved.forEach {
notes.remove(it.key)
}
}
fun pruneOldAndHiddenMessages(account: Account) {