From 266c4212232b03275821b5f33f7c402316e029d0 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 8 Sep 2019 14:22:08 -0700 Subject: [PATCH] Fix flickering (thanks Matrix spec) --- src/Main.elm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Main.elm b/src/Main.elm index e367fbf..09cf662 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -345,7 +345,9 @@ updateSyncResponse model r notify = (Just rid, Just re) -> setReadMarkers model.apiUrl token rid re.eventId <| Just re.eventId _ -> Cmd.none receivedEvents sr = List.map Just <| allTimelineEventIds sr - sending sr = Dict.filter (\_ (rid, { body, id }) -> not <| List.member id <| receivedEvents sr) model.sending + receivedTransactions sr = List.filterMap (Maybe.andThen .transactionId << .unsigned) + <| allTimelineEvents sr + sending sr = Dict.filter (\tid (rid, { body, id }) -> not <| List.member (String.fromInt tid) <| receivedTransactions sr) model.sending newSync sr = mergeSyncResponse model.sync sr newModel sr = { model | sync = newSync sr