mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fix for the content not updating after an edit, restore the usage of the content based identifier in the formatted body for components.
This commit is contained in:
@@ -37,7 +37,8 @@ extension AttributedString {
|
||||
.plainText
|
||||
}
|
||||
|
||||
components.append(AttributedStringBuilderComponent(attributedString: attributedString,
|
||||
components.append(AttributedStringBuilderComponent(id: String(attributedString.characters),
|
||||
attributedString: attributedString,
|
||||
type: componentType))
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,15 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
struct AttributedStringBuilderComponent: Hashable {
|
||||
struct AttributedStringBuilderComponent: Hashable, Identifiable {
|
||||
enum ComponentType {
|
||||
case plainText
|
||||
case blockquote
|
||||
case codeBlock
|
||||
}
|
||||
|
||||
/// Identifier for the `Identifiable` conformance, allows edits to the `FormattedBodyText` to animate seamlessly
|
||||
let id: String
|
||||
let attributedString: AttributedString
|
||||
let type: ComponentType
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user