channel chat: Set first loaded message ID when sending a message (#10034)

Discovered while looking into #10024.

When clicking on a reply message text, the original message should be
highlighted accordingly. However this would not work when the channel
was just created and the user is the only one that sent messages.
 
Release Notes:

- Fixed highlighting of messages when clicking on the reply message text
in the chat and there were no other messages from other users
This commit is contained in:
Bennet Bo Fenner 2024-04-04 15:12:35 +02:00 committed by GitHub
parent 1085642c88
commit 27165e9927
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -222,6 +222,9 @@ impl ChannelChat {
let message = ChannelMessage::from_proto(response, &user_store, &mut cx).await?;
this.update(&mut cx, |this, cx| {
this.insert_messages(SumTree::from_item(message, &()), cx);
if this.first_loaded_message_id.is_none() {
this.first_loaded_message_id = Some(id);
}
})?;
Ok(id)
}))