mirror of
https://github.com/discourse/discourse.git
synced 2025-05-17 15:13:09 +08:00
FIX: ensures updateLastRead is called when receiving a message (#20728)
This behavior is hard to test as it's mostly fixing a race condition: User A sends a message at the same time than User B, which as a result doesn't cause a scroll for the second message and we don't update last read unless we do a small up and down scroll. `updateLastRead` is debounced so it has no direct consequences to call it slightly more often than what should ideally be needed.
This commit is contained in:
parent
293cb7bde2
commit
aa8eff5e16
@ -613,6 +613,7 @@ export default class ChatLivePane extends Component {
|
|||||||
const message = ChatMessage.create(this.args.channel, data.chat_message);
|
const message = ChatMessage.create(this.args.channel, data.chat_message);
|
||||||
this.args.channel.addMessages([message]);
|
this.args.channel.addMessages([message]);
|
||||||
this.scrollToLatestMessage();
|
this.scrollToLatestMessage();
|
||||||
|
this.updateLastReadMessage();
|
||||||
} else {
|
} else {
|
||||||
// If we are almost at the bottom, we append the message and notice the user
|
// If we are almost at the bottom, we append the message and notice the user
|
||||||
const message = ChatMessage.create(this.args.channel, data.chat_message);
|
const message = ChatMessage.create(this.args.channel, data.chat_message);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user