When we only show one compose button, show upload (#7165)

pull/21833/head
Andy Balaam 2021-11-19 14:01:07 +00:00 committed by GitHub
parent bd09fc2231
commit a2c662272e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -472,6 +472,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
}; };
private renderButtons(menuPosition): JSX.Element | JSX.Element[] { private renderButtons(menuPosition): JSX.Element | JSX.Element[] {
let uploadButtonIndex = 0;
const buttons: JSX.Element[] = []; const buttons: JSX.Element[] = [];
if (!this.state.haveRecording) { if (!this.state.haveRecording) {
if (SettingsStore.getValue("feature_polls")) { if (SettingsStore.getValue("feature_polls")) {
@ -479,6 +480,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
<PollButton key="polls" room={this.props.room} />, <PollButton key="polls" room={this.props.room} />,
); );
} }
uploadButtonIndex = buttons.length;
buttons.push( buttons.push(
<UploadButton <UploadButton
key="controls_upload" key="controls_upload"
@ -528,7 +530,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
}); });
return <> return <>
{ buttons[0] } { buttons[uploadButtonIndex] }
<AccessibleTooltipButton <AccessibleTooltipButton
className={classnames} className={classnames}
onClick={this.toggleButtonMenu} onClick={this.toggleButtonMenu}