Add id field for sending messages.
The idea is to use this field to dismiss messages only when a sync response with their id arrives.
This commit is contained in:
@@ -121,7 +121,7 @@ updateMarkdown m { roomId, text, markdown } =
|
||||
sendMessageCmd = sendMarkdownMessage m.apiUrl (Maybe.withDefault "" m.token) (m.transactionId + 1) roomId text markdown
|
||||
newModel =
|
||||
{ m | transactionId = m.transactionId + 1
|
||||
, sending = Dict.insert (m.transactionId + 1) (roomId, TextMessage text) m.sending
|
||||
, sending = Dict.insert (m.transactionId + 1) (roomId, { body = TextMessage text, id = Nothing }) m.sending
|
||||
}
|
||||
in
|
||||
(newModel, Cmd.batch [ storeValueCmd, sendMessageCmd, requestScrollCmd ])
|
||||
|
||||
Reference in New Issue
Block a user