summaryrefslogtreecommitdiffstats
path: root/webapp/components/channel_info_modal.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-04-29 08:40:06 -0400
committerChristopher Speller <crspeller@gmail.com>2016-04-29 08:40:06 -0400
commit1f4974dc02c786b65c802d4497fd736cca79d01c (patch)
tree1007e452c4a9345dee8aff113f28f235432bf323 /webapp/components/channel_info_modal.jsx
parent9961ccca7d39bdfabbafce423d3f7fe4b6ed2f29 (diff)
downloadchat-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.jsx13
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
+};