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

Hide empty MessageActionBar on message edit history dialog #10447

Merged
merged 6 commits into from
May 18, 2023
Merged
19 changes: 12 additions & 7 deletions src/components/views/messages/EditHistoryMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,18 @@ export default class EditHistoryMessage extends React.PureComponent<IProps, ISta
);
}

// disabled remove button when not allowed
return (
<div className="mx_MessageActionBar">
{redactButton}
{viewSourceButton}
</div>
);
if (!redactButton && !viewSourceButton) {
// Hide the empty MessageActionBar
return null;
robintown marked this conversation as resolved.
Show resolved Hide resolved
} else {
// disabled remove button when not allowed
return (
<div className="mx_MessageActionBar">
{redactButton}
{viewSourceButton}
</div>
);
}
}

public render(): React.ReactNode {
Expand Down