File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
src/components/MessageList Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ class MessageList extends PureComponent {
166166 this . setState ( { newMessagesNotification : false } ) ;
167167 } ;
168168
169- userScrolledUp = ( ) => this . scrollOffset > 200 ;
169+ userScrolledUp = ( ) => this . scrollOffset > this . props . scrolledUpThreshold ;
170170
171171 listenToScroll = ( offset , reverseOffset , threshold ) => {
172172 this . scrollOffset = offset ;
@@ -455,6 +455,8 @@ MessageList.propTypes = {
455455 * The user roles allowed to pin messages in various channel types
456456 */
457457 pinPermissions : /** @type {PropTypes.Validator<import('types').PinPermissions>> } */ ( PropTypes . object ) ,
458+ /** The pixel threshold to determine whether or not the user is scrolled up in the list */
459+ scrolledUpThreshold : PropTypes . number ,
458460} ;
459461
460462MessageList . defaultProps = {
@@ -471,6 +473,7 @@ MessageList.defaultProps = {
471473 noGroupByUser : false ,
472474 messageActions : Object . keys ( MESSAGE_ACTIONS ) ,
473475 pinPermissions : defaultPinPermissions ,
476+ scrolledUpThreshold : 200 ,
474477} ;
475478
476479export default withTranslationContext ( ( props ) => (
Original file line number Diff line number Diff line change @@ -673,6 +673,7 @@ export interface MessageListProps {
673673 e : React . MouseEvent ,
674674 mentioned_users : Client . UserResponse [ ] ,
675675 ) : void ;
676+ scrolledUpThreshold ?: number ;
676677}
677678
678679export interface ChannelHeaderProps {
You can’t perform that action at this time.
0 commit comments