diff --git a/src/components/structures/MessagePanel.tsx b/src/components/structures/MessagePanel.tsx index 464a82302d..a0a1ac9b10 100644 --- a/src/components/structures/MessagePanel.tsx +++ b/src/components/structures/MessagePanel.tsx @@ -814,7 +814,7 @@ export default class MessagePanel extends React.Component { private collectEventNode = (eventId: string, node: EventTile): void => { this.eventNodes[eventId] = node?.ref?.current; - } + }; // once dynamic content in the events load, make the scrollPanel check the // scroll offsets. @@ -1085,7 +1085,7 @@ class CreationGrouper extends BaseGrouper { class RedactionGrouper extends BaseGrouper { static canStartGroup = function(panel: MessagePanel, ev: MatrixEvent): boolean { return panel.shouldShowEvent(ev) && ev.isRedacted(); - } + }; constructor( panel: MessagePanel, @@ -1181,7 +1181,7 @@ class RedactionGrouper extends BaseGrouper { class MemberGrouper extends BaseGrouper { static canStartGroup = function(panel: MessagePanel, ev: MatrixEvent): boolean { return panel.shouldShowEvent(ev) && membershipTypes.includes(ev.getType() as EventType); - } + }; constructor( public readonly panel: MessagePanel, diff --git a/src/components/structures/TimelinePanel.tsx b/src/components/structures/TimelinePanel.tsx index 511862be1b..e4c7d15596 100644 --- a/src/components/structures/TimelinePanel.tsx +++ b/src/components/structures/TimelinePanel.tsx @@ -374,7 +374,7 @@ class TimelinePanel extends React.Component { events, liveEvents, firstVisibleEventIndex, - } + }; // We can now paginate in the unpaginated direction if (backwards) { @@ -661,7 +661,7 @@ class TimelinePanel extends React.Component { }; private onSync = (clientSyncState: SyncState, prevState: SyncState, data: object): void => { - this.setState({ clientSyncState }); + this.setState({ clientSyncState }); }; private readMarkerTimeout(readMarkerPosition: number): number { @@ -885,15 +885,13 @@ class TimelinePanel extends React.Component { if (this.timelineWindow.canPaginate(EventTimeline.FORWARDS)) { this.loadTimeline(); } else { - if (this.messagePanel.current) { - this.messagePanel.current.scrollToBottom(); - } + this.messagePanel.current?.scrollToBottom(); } }; public scrollToEventIfNeeded = (eventId: string): void => { this.messagePanel.current?.scrollToEventIfNeeded(eventId); - } + }; /* scroll to show the read-up-to marker. We put it 1/3 of the way down * the container. @@ -948,11 +946,10 @@ class TimelinePanel extends React.Component { * at the end of the live timeline. */ public isAtEndOfLiveTimeline = (): boolean => { - return this.messagePanel.current - && this.messagePanel.current.isAtBottom() + return this.messagePanel.current?.isAtBottom() && this.timelineWindow && !this.timelineWindow.canPaginate(EventTimeline.FORWARDS); - } + }; /* get the current scroll state. See ScrollPanel.getScrollState for * details. diff --git a/src/components/views/dialogs/ForwardDialog.tsx b/src/components/views/dialogs/ForwardDialog.tsx index b277021157..ba06436ae2 100644 --- a/src/components/views/dialogs/ForwardDialog.tsx +++ b/src/components/views/dialogs/ForwardDialog.tsx @@ -170,7 +170,7 @@ const ForwardDialog: React.FC = ({ matrixClient: cli, event, permalinkCr userId, getAvatarUrl: (..._) => { return avatarUrlForUser( - {avatarUrl: profileInfo.avatar_url}, + { avatarUrl: profileInfo.avatar_url }, AVATAR_SIZE, AVATAR_SIZE, "crop", ); },