fix flashing by ""

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-04-27 23:16:08 +01:00
parent 9dd204dd10
commit a399b1018a

View file

@ -29,7 +29,7 @@ const RedactedBody = React.forwardRef<any, IProps>(({mxEvent}, ref) => {
let text = _t("Message deleted"); let text = _t("Message deleted");
const redactedBecauseUserId = mxEvent.getUnsigned().redacted_because.sender; const redactedBecauseUserId = mxEvent.getUnsigned().redacted_because.sender;
if (redactedBecauseUserId !== cli.getUserId()) { if (redactedBecauseUserId && redactedBecauseUserId !== cli.getUserId()) {
const room = cli.getRoom(mxEvent.getRoomId()); const room = cli.getRoom(mxEvent.getRoomId());
const sender = room && room.getMember(redactedBecauseUserId); const sender = room && room.getMember(redactedBecauseUserId);
text = _t("Message deleted by %(name)s", { name: sender ? sender.name : redactedBecauseUserId }); text = _t("Message deleted by %(name)s", { name: sender ? sender.name : redactedBecauseUserId });