Skip to content

Conversation

Jikstra
Copy link
Contributor

@Jikstra Jikstra commented Dec 12, 2019

Fixes #1222

@@ -41,8 +41,10 @@ export default function MessageList ({ chat, refComposer, locationStreamingEnabl

useEffect(() => {
if (scrollToBottomIfClose === false) return
if (messageListRef.current.scrollHeight - messageListRef.current.scrollTop > 400) {
// we are close to bottom so scroll down to show the new message
// For whatever reason the scrollTop is ~1000 off...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the protocol: I do not like this "we don't know what its doing lets fix it anyway somehow" approach

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me neither. Feel free to figure it out, didn't find the reason for this. Actually i threw out that code path as it's weird ux.

@Simon-Laux
Copy link
Member

Simon-Laux commented Dec 12, 2019

The scrolling is not working (I only tested it with the window in the background) but the update bug is fixed so I will approve

@@ -66,8 +66,7 @@ chatStore.reducers.push(({ type, payload, id }, state) => {
messages: {
...state.messages,
...payload.messagesIncoming
},
scrollToBottomIfClose: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is needed: in my tests it only scrolls down if this is true. Why did you remove it?

@Jikstra
Copy link
Contributor Author

Jikstra commented Dec 13, 2019

For whatever reason some commits aren't shown in this pr, this is probably why stuff is missing. Not sure why.

@nicodh nicodh merged commit 3d7e01f into master Dec 13, 2019
@nicodh nicodh deleted the fix_1222 branch December 13, 2019 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Receiving message in chat but message not added to the chat area
3 participants