Fixes #2286 - Timeline entries flickering when a lot of mention pills present
This commit is contained in:
committed by
Stefan Ceriu
parent
60ec0d8300
commit
075ff355cf
@@ -18,7 +18,12 @@ import Foundation
|
||||
|
||||
extension AttributedString {
|
||||
var formattedComponents: [AttributedStringBuilderComponent] {
|
||||
runs[\.blockquote].map { value, range in
|
||||
var components = [AttributedStringBuilderComponent]()
|
||||
|
||||
for (index, run) in runs[\.blockquote].enumerated() {
|
||||
let value = run.0
|
||||
let range = run.1
|
||||
|
||||
var attributedString = AttributedString(self[range])
|
||||
|
||||
// Remove trailing new lines if any
|
||||
@@ -29,8 +34,10 @@ extension AttributedString {
|
||||
|
||||
let isBlockquote = value != nil
|
||||
|
||||
return AttributedStringBuilderComponent(attributedString: attributedString, isBlockquote: isBlockquote)
|
||||
components.append(AttributedStringBuilderComponent(id: index, attributedString: attributedString, isBlockquote: isBlockquote))
|
||||
}
|
||||
|
||||
return components
|
||||
}
|
||||
|
||||
/// Replaces the specified placeholder with a string that links to the specified URL.
|
||||
|
||||
Reference in New Issue
Block a user