From 2769685c13ef22dc46e6c1b04080e6e2a371e575 Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Thu, 6 Apr 2023 15:51:59 +0200 Subject: [PATCH] Remove temp events only on confirmed sync --- src/Internal/Values/Room.elm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Internal/Values/Room.elm b/src/Internal/Values/Room.elm index 024639d..4a1d055 100644 --- a/src/Internal/Values/Room.elm +++ b/src/Internal/Values/Room.elm @@ -87,7 +87,14 @@ addEvents ({ events } as data) (IRoom room) = { room | events = List.foldl Hashdict.insert room.events events , timeline = Timeline.addNewEvents data room.timeline - , tempEvents = [] + , tempEvents = + List.filter + (\tempEvent -> + List.member + (IEvent.eventId tempEvent) + (List.map IEvent.eventId events) + ) + room.tempEvents }