Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

fix read receipts trickling down correctly #9567

Merged
merged 3 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/components/views/avatars/MemberAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@ export default function MemberAvatar({
/>
);
}

export class LegacyMemberAvatar extends React.Component<IProps> {
Copy link
Member

@t3chguy t3chguy Nov 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not just use forwardRef((props, ref) => {... <div ref={ref} />}); on the main export

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not easily. You'll have to change MemberAvatar as a forwardRef, then BaseAvatar, and then you end up with having either React.ReactInstance objects or HTMLElement. And the HTMLElement already receive a reference coming from a prop called inputRef...

So the refactor is more involved and probably not worth the risk right now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is fair, could we open an issue to refactor NodeAnimator to be FC-friendly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public render(): JSX.Element {
return <MemberAvatar {...this.props}>
{ this.props.children }
</MemberAvatar>;
}
}
2 changes: 1 addition & 1 deletion src/components/views/rooms/ReadReceiptMarker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { logger } from "matrix-js-sdk/src/logger";

import NodeAnimator from "../../../NodeAnimator";
import { toPx } from "../../../utils/units";
import MemberAvatar from '../avatars/MemberAvatar';
import { LegacyMemberAvatar as MemberAvatar } from '../avatars/MemberAvatar';
import { READ_AVATAR_SIZE } from "./ReadReceiptGroup";

export interface IReadReceiptInfo {
Expand Down