Include providers and transformations in icon cache hash

This commit is contained in:
MM20 2023-08-29 23:08:13 +02:00
parent b20e15f3bc
commit a0ee1fbc9f
No known key found for this signature in database
GPG Key ID: 0B61A8F2DEAFA389

View File

@ -142,7 +142,7 @@ class IconService(
fun getIcon(searchable: SavableSearchable, size: Int): Flow<LauncherIcon?> { fun getIcon(searchable: SavableSearchable, size: Int): Flow<LauncherIcon?> {
val customIcon = customAttributesRepository.getCustomIcon(searchable) val customIcon = customAttributesRepository.getCustomIcon(searchable)
return combine(iconProviders, transformations, customIcon) { providers, transformations, ci -> return combine(iconProviders, transformations, customIcon) { providers, transformations, ci ->
var icon = cache.get(searchable.key + ci.hashCode()) var icon = cache.get(searchable.key + ci.hashCode() + providers.hashCode() + transformations.hashCode())
if (icon != null) { if (icon != null) {
return@combine icon return@combine icon
} }
@ -155,7 +155,7 @@ class IconService(
if (icon != null) { if (icon != null) {
icon = icon.transform(transforms) icon = icon.transform(transforms)
cache.put(searchable.key + ci.hashCode(), icon) cache.put(searchable.key + ci.hashCode() + providers.hashCode() + transformations.hashCode(), icon)
} }
return@combine icon return@combine icon
} }