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

Commit

Permalink
Cope with the list ending with events not to show
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk committed Mar 8, 2024
1 parent 80dd553 commit 7741ab6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/structures/MessagePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,11 @@ export default class MessagePanel extends React.Component<IProps, IState> {
const currentEventId =
this.focusedEventId ||
this.props.highlightedEventId ||
(events[events.length - 1] ? events[events.length - 1].event.getId()! : null);
events.reduce(
// Get the id of the last event in the list that's shown.
(prev, { event, shouldShow }) => shouldShow ? event.getId() : prev,

Check failure on line 438 in src/components/structures/MessagePanel.tsx

View workflow job for this annotation

GitHub Actions / Typescript Syntax Check

No overload matches this call.
null as string | null,
);
if (navAction === KeyBindingAction.SelectPrevMessage) {
events.reverse();
}
Expand Down

0 comments on commit 7741ab6

Please sign in to comment.