mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-11 22:40:27 +00:00
shouldComponentUpdate implemented for SubtitlesButton
This commit is contained in:
parent
1a8432a8c9
commit
799dd2f2b7
1 changed files with 13 additions and 1 deletions
|
|
@ -15,6 +15,18 @@ class SubtitlesButton extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps, nextState) {
|
||||
return nextState.popupOpen !== this.state.popupOpen ||
|
||||
nextProps.className !== this.props.className ||
|
||||
nextProps.popupContainerClassName !== this.props.popupContainerClassName ||
|
||||
nextProps.popupContentClassName !== this.props.popupContentClassName ||
|
||||
nextProps.subtitleTracks !== this.props.subtitleTracks ||
|
||||
nextProps.selectedSubtitleTrackId !== this.props.selectedSubtitleTrackId ||
|
||||
nextProps.subtitleSize !== this.props.subtitleSize ||
|
||||
nextProps.subtitleDelay !== this.props.subtitleDelay ||
|
||||
nextProps.subtitleDarkBackground !== this.props.subtitleDarkBackground;
|
||||
}
|
||||
|
||||
onPopupOpen = () => {
|
||||
this.setState({ popupOpen: true });
|
||||
}
|
||||
|
|
@ -63,7 +75,7 @@ SubtitlesButton.propTypes = {
|
|||
dispatch: PropTypes.func.isRequired
|
||||
};
|
||||
SubtitlesButton.defaultProps = {
|
||||
subtitleTracks: []
|
||||
subtitleTracks: Object.freeze([])
|
||||
};
|
||||
|
||||
module.exports = SubtitlesButton;
|
||||
|
|
|
|||
Loading…
Reference in a new issue