Remove temp events only on confirmed sync

pull/1/head
Bram van den Heuvel 2023-04-06 15:51:59 +02:00
parent 290be4e746
commit 2769685c13
1 changed files with 8 additions and 1 deletions

View File

@ -87,7 +87,14 @@ addEvents ({ events } as data) (IRoom room) =
{ room { room
| events = List.foldl Hashdict.insert room.events events | events = List.foldl Hashdict.insert room.events events
, timeline = Timeline.addNewEvents data room.timeline , timeline = Timeline.addNewEvents data room.timeline
, tempEvents = [] , tempEvents =
List.filter
(\tempEvent ->
List.member
(IEvent.eventId tempEvent)
(List.map IEvent.eventId events)
)
room.tempEvents
} }