mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
Prevent unneeded state updates to hide StickerPicker
This commit is contained in:
parent
525e3eaf43
commit
73d51a91d6
1 changed files with 10 additions and 4 deletions
|
@ -40,7 +40,7 @@ const STICKERPICKER_Z_INDEX = 3500;
|
||||||
const PERSISTED_ELEMENT_KEY = "stickerPicker";
|
const PERSISTED_ELEMENT_KEY = "stickerPicker";
|
||||||
|
|
||||||
@replaceableComponent("views.rooms.Stickerpicker")
|
@replaceableComponent("views.rooms.Stickerpicker")
|
||||||
export default class Stickerpicker extends React.Component {
|
export default class Stickerpicker extends React.PureComponent {
|
||||||
static currentWidget;
|
static currentWidget;
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -341,21 +341,27 @@ export default class Stickerpicker extends React.Component {
|
||||||
* @param {Event} ev Event that triggered the function call
|
* @param {Event} ev Event that triggered the function call
|
||||||
*/
|
*/
|
||||||
_onHideStickersClick(ev) {
|
_onHideStickersClick(ev) {
|
||||||
this.setState({showStickers: false});
|
if (this.state.showStickers) {
|
||||||
|
this.setState({showStickers: false});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the window is resized
|
* Called when the window is resized
|
||||||
*/
|
*/
|
||||||
_onResize() {
|
_onResize() {
|
||||||
this.setState({showStickers: false});
|
if (this.state.showStickers) {
|
||||||
|
this.setState({showStickers: false});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The stickers picker was hidden
|
* The stickers picker was hidden
|
||||||
*/
|
*/
|
||||||
_onFinished() {
|
_onFinished() {
|
||||||
this.setState({showStickers: false});
|
if (this.state.showStickers) {
|
||||||
|
this.setState({showStickers: false});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue