|
|
|
|
@ -8,7 +8,6 @@ import { CALLBACKS, SOCKET_MESSAGE_TYPES } from '../../utils/websocket.js';
@@ -8,7 +8,6 @@ import { CALLBACKS, SOCKET_MESSAGE_TYPES } from '../../utils/websocket.js';
|
|
|
|
|
import { |
|
|
|
|
jumpToBottom, |
|
|
|
|
debounce, |
|
|
|
|
setLocalStorage, |
|
|
|
|
} from '../../utils/helpers.js'; |
|
|
|
|
import { extraUserNamesFromMessageHistory } from '../../utils/chat.js'; |
|
|
|
|
import { |
|
|
|
|
@ -295,6 +294,7 @@ export default class Chat extends Component {
@@ -295,6 +294,7 @@ export default class Chat extends Component {
|
|
|
|
|
const shouldScroll = |
|
|
|
|
scrollHeight >= clientHeight && |
|
|
|
|
fullyScrolled - scrollTop < MESSAGE_JUMPTOBOTTOM_BUFFER; |
|
|
|
|
|
|
|
|
|
return shouldScroll; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -315,6 +315,7 @@ export default class Chat extends Component {
@@ -315,6 +315,7 @@ export default class Chat extends Component {
|
|
|
|
|
// if the messages list grows in number of child message nodes due to new messages received, scroll to bottom.
|
|
|
|
|
messageListCallback(mutations) { |
|
|
|
|
const numMutations = mutations.length; |
|
|
|
|
|
|
|
|
|
if (numMutations) { |
|
|
|
|
const item = mutations[numMutations - 1]; |
|
|
|
|
if (item.type === 'childList' && item.addedNodes.length) { |
|
|
|
|
|