mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Fixes #1455 - Use the stable timeline id to match timeline items in between local echo and remote echo states
This commit is contained in:
committed by
Stefan Ceriu
parent
74e0f03356
commit
10259e9345
@@ -96,7 +96,7 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
}
|
||||
|
||||
func processItemAppearance(_ itemID: TimelineItemIdentifier) async {
|
||||
guard let timelineItem = timelineItems.first(where: { $0.id == itemID }) else {
|
||||
guard let timelineItem = timelineItems.firstUsingStableID(itemID) else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
func processItemDisappearance(_ itemID: TimelineItemIdentifier) { }
|
||||
|
||||
func processItemTap(_ itemID: TimelineItemIdentifier) async -> RoomTimelineControllerAction {
|
||||
guard let timelineItem = timelineItems.first(where: { $0.id == itemID }) else {
|
||||
guard let timelineItem = timelineItems.firstUsingStableID(itemID) else {
|
||||
return .none
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
|
||||
func editMessage(_ newMessage: String, original itemID: TimelineItemIdentifier) async {
|
||||
MXLog.info("Edit message in \(roomID)")
|
||||
if let timelineItem = timelineItems.first(where: { $0.id == itemID }),
|
||||
if let timelineItem = timelineItems.firstUsingStableID(itemID),
|
||||
let item = timelineItem as? EventBasedTimelineItemProtocol,
|
||||
item.hasFailedToSend {
|
||||
MXLog.info("Editing a failed echo, will cancel and resend it as a new message")
|
||||
|
||||
Reference in New Issue
Block a user