@@ -768,21 +768,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
768768 }
769769 }
770770
771- private onUserScroll = ( ) => {
772- if ( this . state . initialEventId && this . state . initialEventScrollIntoView ) {
773- debuglog ( "Removing scroll_into_view flag from initial event" ) ;
774- dis . dispatch < ViewRoomPayload > ( {
775- action : Action . ViewRoom ,
776- room_id : this . state . room . roomId ,
777- event_id : this . state . initialEventId ,
778- highlighted : this . state . isInitialEventHighlighted ,
779- scroll_into_view : false ,
780- replyingToEvent : this . state . replyToEvent ,
781- metricsTrigger : undefined , // room doesn't change
782- } ) ;
783- }
784- } ;
785-
786771 private onRightPanelStoreUpdate = ( ) => {
787772 this . setState ( {
788773 showRightPanel : RightPanelStore . instance . isOpenForRoom ( this . state . roomId ) ,
@@ -1311,6 +1296,19 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
13111296 } ) ;
13121297 }
13131298 this . updateTopUnreadMessagesBar ( ) ;
1299+
1300+ if ( this . state . initialEventId && this . state . initialEventScrollIntoView ) {
1301+ debuglog ( "Removing scroll_into_view flag from initial event" ) ;
1302+ dis . dispatch < ViewRoomPayload > ( {
1303+ action : Action . ViewRoom ,
1304+ room_id : this . state . room . roomId ,
1305+ event_id : this . state . initialEventId ,
1306+ highlighted : this . state . isInitialEventHighlighted ,
1307+ scroll_into_view : false ,
1308+ replyingToEvent : this . state . replyToEvent ,
1309+ metricsTrigger : undefined , // room doesn't change
1310+ } ) ;
1311+ }
13141312 } ;
13151313
13161314 private injectSticker ( url : string , info : object , text : string , threadId : string | null ) {
@@ -2066,7 +2064,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
20662064 eventScrollIntoView = { this . state . initialEventScrollIntoView }
20672065 eventPixelOffset = { this . state . initialEventPixelOffset }
20682066 onScroll = { this . onMessageListScroll }
2069- onUserScroll = { this . onUserScroll }
20702067 onReadMarkerUpdated = { this . updateTopUnreadMessagesBar }
20712068 showUrlPreview = { this . state . showUrlPreview }
20722069 className = { this . messagePanelClassNames }
0 commit comments