Solves the sorting contract crash by precaching all values before sorting.
This commit is contained in:
@@ -2298,12 +2298,17 @@ object LocalCache : ILocalCache, ICacheProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val findsFollowing = finds.associateWith { forAccount?.isFollowing(it) == true }
|
||||||
|
val anyNameStartsWith = finds.associateWith { it.metadataOrNull()?.anyNameStartsWith(dualCase) == true }
|
||||||
|
val anyAddressStartsWith = finds.associateWith { it.metadataOrNull()?.anyAddressStartsWith(dualCase) == true }
|
||||||
|
val displayNames = finds.associateWith { it.toBestDisplayName().lowercase() }
|
||||||
|
|
||||||
return finds.sortedWith(
|
return finds.sortedWith(
|
||||||
compareBy(
|
compareBy(
|
||||||
{ forAccount?.isFollowing(it) == false },
|
{ findsFollowing[it] == false },
|
||||||
{ it.metadataOrNull()?.anyNameStartsWith(dualCase) == false },
|
{ anyNameStartsWith[it] == false },
|
||||||
{ it.metadataOrNull()?.anyAddressStartsWith(dualCase) == false },
|
{ anyAddressStartsWith[it] == false },
|
||||||
{ it.toBestDisplayName().lowercase() },
|
{ displayNames[it] },
|
||||||
{ it.pubkeyHex },
|
{ it.pubkeyHex },
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user