Fix vector-im/element-x-ios/issues/134 - Prevent home screen room last message attributed string from being computed on every update

Add async/await methods to the AttributedStringBuilder and adopt them throughout the app
This commit is contained in:
Stefan Ceriu
2022-07-22 10:25:17 +03:00
committed by GitHub
parent 2f4fb81aa5
commit e1eee9465e
11 changed files with 147 additions and 89 deletions
@@ -46,21 +46,21 @@ class RoomSummary: RoomSummaryProtocol {
roomProxy.isTombstoned
}
private(set) var avatar: UIImage? {
didSet {
callbacks.send(.updatedAvatar)
}
}
private(set) var displayName: String? {
didSet {
callbacks.send(.updatedData)
callbacks.send(.updatedDisplayName)
}
}
private(set) var lastMessage: EventBrief? {
didSet {
callbacks.send(.updatedData)
}
}
private(set) var avatar: UIImage? {
didSet {
callbacks.send(.updatedData)
callbacks.send(.updatedLastMessage)
}
}
@@ -10,7 +10,9 @@ import Combine
import UIKit
enum RoomSummaryCallback {
case updatedData
case updatedAvatar
case updatedDisplayName
case updatedLastMessage
}
@MainActor