mirror of https://github.com/vector-im/riot-web
Fix view source from edit history dialog always showing latest event (#10626)
parent
a092a91cd9
commit
270a26d89a
|
@ -31,6 +31,7 @@ import CopyableText from "../views/elements/CopyableText";
|
|||
|
||||
interface IProps {
|
||||
mxEvent: MatrixEvent; // the MatrixEvent associated with the context menu
|
||||
ignoreEdits?: boolean;
|
||||
onFinished(): void;
|
||||
}
|
||||
|
||||
|
@ -58,7 +59,11 @@ export default class ViewSource extends React.Component<IProps, IState> {
|
|||
|
||||
// returns the dialog body for viewing the event source
|
||||
private viewSourceContent(): JSX.Element {
|
||||
const mxEvent = this.props.mxEvent.replacingEvent() || this.props.mxEvent; // show the replacing event, not the original, if it is an edit
|
||||
let mxEvent = this.props.mxEvent.replacingEvent() || this.props.mxEvent; // show the replacing event, not the original, if it is an edit
|
||||
if (this.props.ignoreEdits) {
|
||||
mxEvent = this.props.mxEvent;
|
||||
}
|
||||
|
||||
const isEncrypted = mxEvent.isEncrypted();
|
||||
// @ts-ignore
|
||||
const decryptedEventSource = mxEvent.clearEvent; // FIXME: clearEvent is private
|
||||
|
|
|
@ -92,6 +92,7 @@ export default class EditHistoryMessage extends React.PureComponent<IProps, ISta
|
|||
ViewSource,
|
||||
{
|
||||
mxEvent: this.props.mxEvent,
|
||||
ignoreEdits: true,
|
||||
},
|
||||
"mx_Dialog_viewsource",
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue