use null vars for context menu lists

Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
pull/21833/head
Michael Weimann 2021-06-24 22:06:12 +02:00
parent 086042f078
commit e685f1239d
No known key found for this signature in database
GPG Key ID: 34F0524D4DA694A1
1 changed files with 7 additions and 6 deletions

View File

@ -257,7 +257,7 @@ export default class MessageContextMenu extends React.Component {
let externalURLButton;
let quoteButton;
let collapseReplyThread;
const optionLists = [];
let redactItemList;
// status is SENT before remote-echo, null after
const isSent = !eventStatus || eventStatus === EventStatus.SENT;
@ -388,7 +388,7 @@ export default class MessageContextMenu extends React.Component {
);
}
optionLists.push((
const commonItemsList = (
<IconizedContextMenuOptionList key={'group1'}>
{ quoteButton }
{ forwardButton }
@ -401,14 +401,14 @@ export default class MessageContextMenu extends React.Component {
{ resendReactionsButton }
{ collapseReplyThread }
</IconizedContextMenuOptionList>
));
);
if (redactButton) {
optionLists.push((
redactItemList = (
<IconizedContextMenuOptionList key={'group2'} red>
{ redactButton }
</IconizedContextMenuOptionList>
));
);
}
return (
@ -417,7 +417,8 @@ export default class MessageContextMenu extends React.Component {
className="mx_MessageContextMenu"
compact={true}
>
{ optionLists }
{ commonItemsList }
{ redactItemList }
</IconizedContextMenu>
);
}