Hide sticker picker for local rooms (#9174)

* Disable stickers for local rooms

* Use prop
This commit is contained in:
Michael Weimann 2022-08-11 17:51:24 +02:00 committed by GitHub
parent ed4286aa93
commit 964d538db9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 29 deletions

View file

@ -51,6 +51,7 @@ import { SettingUpdatedPayload } from "../../../dispatcher/payloads/SettingUpdat
import MessageComposerButtons from './MessageComposerButtons';
import { ButtonEvent } from '../elements/AccessibleButton';
import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload";
import { isLocalRoom } from '../../../utils/localRoom/isLocalRoom';
let instanceCount = 0;
@ -350,6 +351,10 @@ export default class MessageComposer extends React.Component<IProps, IState> {
});
};
private get showStickersButton(): boolean {
return this.state.showStickersButton && !isLocalRoom(this.props.room);
}
public render() {
const controls = [
this.props.e2eStatus ?
@ -475,7 +480,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
setStickerPickerOpen={this.setStickerPickerOpen}
showLocationButton={!window.electron}
showPollsButton={this.state.showPollsButton}
showStickersButton={this.state.showStickersButton}
showStickersButton={this.showStickersButton}
toggleButtonMenu={this.toggleButtonMenu}
/> }
{ showSendButton && (