mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 15:45:11 +00:00
Pills performance improvements (#1891)
* big performance improvement for pills * small overall performance improvement * code improvements
This commit is contained in:
@@ -925,3 +925,16 @@ private struct ReplyInfo {
|
||||
let type: EventBasedMessageTimelineItemContentType
|
||||
let isThread: Bool
|
||||
}
|
||||
|
||||
private struct RoomContextKey: EnvironmentKey {
|
||||
@MainActor
|
||||
static let defaultValue = RoomScreenViewModel.mock.context
|
||||
}
|
||||
|
||||
extension EnvironmentValues {
|
||||
/// Used to access and inject and access the room context without observing it
|
||||
var roomContext: RoomScreenViewModel.Context {
|
||||
get { self[RoomContextKey.self] }
|
||||
set { self[RoomContextKey.self] = newValue }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,6 +163,7 @@ class TimelineTableViewController: UIViewController {
|
||||
.id(id)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.environmentObject(coordinator.context) // Attempted fix at a crash in TimelineItemContextMenu
|
||||
.environment(\.roomContext, coordinator.context)
|
||||
}
|
||||
.margins(.all, self.timelineStyle.rowInsets)
|
||||
.minSize(height: 1)
|
||||
|
||||
Reference in New Issue
Block a user