You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-12-05 15:22:09 +03:00
Fix more detached DOM leaks (#10806)
This commit is contained in:
committed by
GitHub
parent
84786ad342
commit
bf641d1823
@@ -54,6 +54,8 @@ export default class AutoHideScrollbar<T extends keyof JSX.IntrinsicElements> ex
|
|||||||
if (this.containerRef.current && this.props.onScroll) {
|
if (this.containerRef.current && this.props.onScroll) {
|
||||||
this.containerRef.current.removeEventListener("scroll", this.props.onScroll);
|
this.containerRef.current.removeEventListener("scroll", this.props.onScroll);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.props.wrappedRef?.(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ export default class MessagePanel extends React.Component<IProps, IState> {
|
|||||||
|
|
||||||
// opaque readreceipt info for each userId; used by ReadReceiptMarker
|
// opaque readreceipt info for each userId; used by ReadReceiptMarker
|
||||||
// to manage its animations
|
// to manage its animations
|
||||||
private readonly readReceiptMap: { [userId: string]: IReadReceiptInfo } = {};
|
private readReceiptMap: { [userId: string]: IReadReceiptInfo } = {};
|
||||||
|
|
||||||
// Track read receipts by event ID. For each _shown_ event ID, we store
|
// Track read receipts by event ID. For each _shown_ event ID, we store
|
||||||
// the list of read receipts to display:
|
// the list of read receipts to display:
|
||||||
@@ -301,6 +301,7 @@ export default class MessagePanel extends React.Component<IProps, IState> {
|
|||||||
this.isMounted = false;
|
this.isMounted = false;
|
||||||
this.props.room?.currentState.off(RoomStateEvent.Update, this.calculateRoomMembersCount);
|
this.props.room?.currentState.off(RoomStateEvent.Update, this.calculateRoomMembersCount);
|
||||||
SettingsStore.unwatchSetting(this.showTypingNotificationsWatcherRef);
|
SettingsStore.unwatchSetting(this.showTypingNotificationsWatcherRef);
|
||||||
|
this.readReceiptMap = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentDidUpdate(prevProps: IProps, prevState: IState): void {
|
public componentDidUpdate(prevProps: IProps, prevState: IState): void {
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ export default class ScrollPanel extends React.Component<IProps> {
|
|||||||
private bottomGrowth: number;
|
private bottomGrowth: number;
|
||||||
private minListHeight: number;
|
private minListHeight: number;
|
||||||
private heightUpdateInProgress: boolean;
|
private heightUpdateInProgress: boolean;
|
||||||
private divScroll: HTMLDivElement;
|
private divScroll: HTMLDivElement | null = null;
|
||||||
|
|
||||||
public constructor(props: IProps) {
|
public constructor(props: IProps) {
|
||||||
super(props);
|
super(props);
|
||||||
@@ -226,6 +226,8 @@ export default class ScrollPanel extends React.Component<IProps> {
|
|||||||
this.unmounted = true;
|
this.unmounted = true;
|
||||||
|
|
||||||
this.props.resizeNotifier?.removeListener("middlePanelResizedNoisy", this.onResize);
|
this.props.resizeNotifier?.removeListener("middlePanelResizedNoisy", this.onResize);
|
||||||
|
|
||||||
|
this.divScroll = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private onScroll = (ev: Event): void => {
|
private onScroll = (ev: Event): void => {
|
||||||
|
|||||||
@@ -250,8 +250,8 @@ interface IState {
|
|||||||
export class UnwrappedEventTile extends React.Component<EventTileProps, IState> {
|
export class UnwrappedEventTile extends React.Component<EventTileProps, IState> {
|
||||||
private suppressReadReceiptAnimation: boolean;
|
private suppressReadReceiptAnimation: boolean;
|
||||||
private isListeningForReceipts: boolean;
|
private isListeningForReceipts: boolean;
|
||||||
private tile = React.createRef<IEventTileType>();
|
private tile = createRef<IEventTileType>();
|
||||||
private replyChain = React.createRef<ReplyChain>();
|
private replyChain = createRef<ReplyChain>();
|
||||||
|
|
||||||
public readonly ref = createRef<HTMLElement>();
|
public readonly ref = createRef<HTMLElement>();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user