diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-04-29 08:40:06 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-04-29 08:40:06 -0400 |
commit | 1f4974dc02c786b65c802d4497fd736cca79d01c (patch) | |
tree | 1007e452c4a9345dee8aff113f28f235432bf323 /webapp/components/channel_info_modal.jsx | |
parent | 9961ccca7d39bdfabbafce423d3f7fe4b6ed2f29 (diff) | |
download | chat-1f4974dc02c786b65c802d4497fd736cca79d01c.tar.gz chat-1f4974dc02c786b65c802d4497fd736cca79d01c.tar.bz2 chat-1f4974dc02c786b65c802d4497fd736cca79d01c.zip |
General react performance improvements (#2796)
* General React performance improvements
* Cleaned up unused props/state in PermaLinkView and PostFocusView
Diffstat (limited to 'webapp/components/channel_info_modal.jsx')
-rw-r--r-- | webapp/components/channel_info_modal.jsx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/webapp/components/channel_info_modal.jsx b/webapp/components/channel_info_modal.jsx index 4c16dda90..d44df4056 100644 --- a/webapp/components/channel_info_modal.jsx +++ b/webapp/components/channel_info_modal.jsx @@ -9,6 +9,17 @@ import {Modal} from 'react-bootstrap'; import React from 'react'; export default class ChannelInfoModal extends React.Component { + shouldComponentUpdate(nextProps) { + if (nextProps.show !== this.props.show) { + return true; + } + + if (!Utils.areObjectsEqual(nextProps.channel, this.props.channel)) { + return true; + } + + return false; + } render() { let channel = this.props.channel; if (!channel) { @@ -93,4 +104,4 @@ ChannelInfoModal.propTypes = { show: React.PropTypes.bool.isRequired, onHide: React.PropTypes.func.isRequired, channel: React.PropTypes.object.isRequired -};
\ No newline at end of file +}; |