When we only show one compose button, show upload (#7165)
This commit is contained in:
parent
bd09fc2231
commit
a2c662272e
1 changed files with 3 additions and 1 deletions
|
@ -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}
|
||||||
|
|
Loading…
Reference in a new issue