Skip to content

Commit

Permalink
Fix notification panel crashes and user name color mode
Browse files Browse the repository at this point in the history
  • Loading branch information
su-ex committed Feb 27, 2023
1 parent a384cfb commit 17bdda6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/components/structures/NotificationPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ import { Layout } from "../../settings/enums/Layout";
import RoomContext, { TimelineRenderingType } from "../../contexts/RoomContext";
import Measured from "../views/elements/Measured";
import Heading from "../views/typography/Heading";
import { UserNameColorMode } from "../../settings/enums/UserNameColorMode";

interface IProps {
onClose(): void;
userNameColorMode?: UserNameColorMode;
}

interface IState {
Expand Down Expand Up @@ -75,6 +77,7 @@ export default class NotificationPanel extends React.PureComponent<IProps, IStat
showUrlPreview={false}
empty={emptyState}
alwaysShowTimestamps={true}
userNameColorMode={this.props.userNameColorMode}
layout={Layout.Group}
/>
);
Expand Down
5 changes: 4 additions & 1 deletion src/components/structures/RightPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ export default class RightPanel extends React.Component<IProps, IState> {
break;

case RightPanelPhases.NotificationPanel:
card = <NotificationPanel onClose={this.onClose} />;
card = <NotificationPanel
onClose={this.onClose}
userNameColorMode={this.props.userNameColorMode}
/>;
break;

case RightPanelPhases.PinnedMessages:
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/messages/DisambiguatedProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default class DisambiguatedProfile extends React.Component<IProps> {
let colorClass: string | undefined;
if (colored) {
colorClass = getUserNameColorClass(
userNameColorMode, fallbackName, MatrixClientPeg.get().getRoom(member.roomId));
userNameColorMode, fallbackName, MatrixClientPeg.get().getRoom(member?.roomId));
}

let mxidElement;
Expand Down
6 changes: 5 additions & 1 deletion src/components/views/rooms/EventTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,11 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
userNameColorMode={this.props.userNameColorMode}
/>;
} else if (this.context.timelineRenderingType === TimelineRenderingType.ThreadsList) {
sender = <SenderProfile mxEvent={this.props.mxEvent} withTooltip />;
sender = <SenderProfile
mxEvent={this.props.mxEvent}
userNameColorMode={this.props.userNameColorMode}
withTooltip
/>;
} else {
sender = <SenderProfile
mxEvent={this.props.mxEvent}
Expand Down

0 comments on commit 17bdda6

Please sign in to comment.