Fix thread list jumping back down while scrolling (#9606)
* Fix timeline jumping after every thread update * Add tests to prevent this from occuring again
This commit is contained in:
parent
5c60211d76
commit
55d9dbf00d
4 changed files with 218 additions and 25 deletions
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||
|
||||
import React, { useContext, useEffect, useRef, useState } from 'react';
|
||||
import { EventTimelineSet } from 'matrix-js-sdk/src/models/event-timeline-set';
|
||||
import { Thread, ThreadEvent } from 'matrix-js-sdk/src/models/thread';
|
||||
import { Thread } from 'matrix-js-sdk/src/models/thread';
|
||||
import { Room } from 'matrix-js-sdk/src/models/room';
|
||||
|
||||
import BaseCard from "../views/right_panel/BaseCard";
|
||||
|
@ -206,18 +206,6 @@ const ThreadPanel: React.FC<IProps> = ({
|
|||
});
|
||||
}, [mxClient, roomId]);
|
||||
|
||||
useEffect(() => {
|
||||
function refreshTimeline() {
|
||||
timelinePanel?.current.refreshTimeline();
|
||||
}
|
||||
|
||||
room?.on(ThreadEvent.Update, refreshTimeline);
|
||||
|
||||
return () => {
|
||||
room?.removeListener(ThreadEvent.Update, refreshTimeline);
|
||||
};
|
||||
}, [room, mxClient, timelineSet]);
|
||||
|
||||
useEffect(() => {
|
||||
if (room) {
|
||||
if (filterOption === ThreadFilterType.My) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue