mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 12:08:12 -05:00
FIX: ensures scrollable-list is passing scroller element (#36736)
Following idle pane refactoring we incorrectly were expecting the scroller from the scrollable-list when we now expect the component (chat-channel/chat-thread) to pass it down. We have tests for this behavior generally but testing the exact scrolling moment is generally brittle, I won't add another test for now.
This commit is contained in:
@@ -475,6 +475,7 @@ export default class ChatChannel extends Component {
|
||||
|
||||
DatesSeparatorsPositioner.apply(this.scroller);
|
||||
this.paneState.updatePendingContentFromScrollState({
|
||||
scroller: this.scroller,
|
||||
fetchedOnce: this.messagesLoader.fetchedOnce,
|
||||
canLoadMoreFuture: this.messagesLoader.canLoadMoreFuture,
|
||||
state,
|
||||
@@ -506,6 +507,7 @@ export default class ChatChannel extends Component {
|
||||
this.chatChannelScrollPositions.delete(this.args.channel.id);
|
||||
} else {
|
||||
this.paneState.updatePendingContentFromScrollState({
|
||||
scroller: this.scroller,
|
||||
fetchedOnce: this.messagesLoader.fetchedOnce,
|
||||
canLoadMoreFuture: this.messagesLoader.canLoadMoreFuture,
|
||||
state,
|
||||
|
||||
@@ -133,6 +133,7 @@ export default class ChatThread extends Component {
|
||||
|
||||
DatesSeparatorsPositioner.apply(this.scroller);
|
||||
this.paneState.updatePendingContentFromScrollState({
|
||||
scroller: this.scroller,
|
||||
fetchedOnce: this.messagesLoader.fetchedOnce,
|
||||
canLoadMoreFuture: this.messagesLoader.canLoadMoreFuture,
|
||||
state,
|
||||
@@ -163,6 +164,7 @@ export default class ChatThread extends Component {
|
||||
this.fetchMoreMessages({ direction: FUTURE });
|
||||
} else {
|
||||
this.paneState.updatePendingContentFromScrollState({
|
||||
scroller: this.scroller,
|
||||
fetchedOnce: this.messagesLoader.fetchedOnce,
|
||||
canLoadMoreFuture: this.messagesLoader.canLoadMoreFuture,
|
||||
state,
|
||||
|
||||
@@ -173,11 +173,16 @@ export default class ChatPaneState {
|
||||
* @param {number} [options.distanceThresholdPixels]
|
||||
*/
|
||||
updatePendingContentFromScrollState(options) {
|
||||
const { fetchedOnce, canLoadMoreFuture, state, distanceThresholdPixels } =
|
||||
options;
|
||||
const {
|
||||
scroller,
|
||||
fetchedOnce,
|
||||
canLoadMoreFuture,
|
||||
state,
|
||||
distanceThresholdPixels,
|
||||
} = options;
|
||||
|
||||
this.#updateHasPendingContentBelow({
|
||||
scroller: state?.scroller,
|
||||
scroller,
|
||||
fetchedOnce,
|
||||
canLoadMoreFuture,
|
||||
distanceToBottomPixels: state?.distanceToBottom?.pixels ?? 0,
|
||||
|
||||
Reference in New Issue
Block a user