Rename properties related to Stickers (#7662)

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Andy Balaam 2022-01-28 10:58:58 +00:00 committed by GitHub
parent cbc671b19f
commit 344b506184
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 25 deletions

View file

@ -255,7 +255,7 @@ interface IState {
me?: RoomMember;
narrowMode?: boolean;
isMenuOpen: boolean;
showStickers: boolean;
isStickerPickerOpen: boolean;
showStickersButton: boolean;
showLocationButton: boolean;
}
@ -286,7 +286,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
haveRecording: false,
recordingTimeLeftSeconds: null, // when set to a number, shows a toast
isMenuOpen: false,
showStickers: false,
isStickerPickerOpen: false,
showStickersButton: SettingsStore.getValue("MessageComposerInput.showStickersButton"),
showLocationButton: (
!window.electron &&
@ -315,7 +315,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
this.setState({
narrowMode,
isMenuOpen: !narrowMode ? false : this.state.isMenuOpen,
showStickers: false,
isStickerPickerOpen: false,
});
}
};
@ -499,8 +499,8 @@ export default class MessageComposer extends React.Component<IProps, IState> {
}
};
private showStickers = (showStickers: boolean) => {
this.setState({ showStickers });
private setStickerPickerOpen = (isStickerPickerOpen: boolean) => {
this.setState({ isStickerPickerOpen });
};
private toggleButtonMenu = (): void => {
@ -547,7 +547,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
if (this.state.showStickersButton) {
let title: string;
if (!this.state.narrowMode) {
title = this.state.showStickers ? _t("Hide Stickers") : _t("Show Stickers");
title = this.state.isStickerPickerOpen ? _t("Hide Stickers") : _t("Show Stickers");
}
buttons.push(
@ -555,7 +555,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
id='stickersButton'
key="controls_stickers"
className="mx_MessageComposer_button mx_MessageComposer_stickers"
onClick={() => this.showStickers(!this.state.showStickers)}
onClick={() => this.setStickerPickerOpen(!this.state.isStickerPickerOpen)}
title={title}
label={this.state.narrowMode ? _t("Send a sticker") : null}
/>,
@ -692,8 +692,8 @@ export default class MessageComposer extends React.Component<IProps, IState> {
<Stickerpicker
room={this.props.room}
threadId={threadId}
showStickers={this.state.showStickers}
setShowStickers={this.showStickers}
isStickerPickerOpen={this.state.isStickerPickerOpen}
setStickerPickerOpen={this.setStickerPickerOpen}
menuPosition={menuPosition}
key="stickers"
/>,