summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-03-29 19:24:53 -0400
committerChristopher Speller <crspeller@gmail.com>2016-03-29 19:24:53 -0400
commite7ea080fd332ca563c3e5e4ea4ed24d86ebf884d (patch)
tree8f78a64e57489c9771c50b5960ef9e2dcd5aa342 /webapp
parenta6a0f18166a29dd22525b690d8141961dbecdb9d (diff)
downloadchat-e7ea080fd332ca563c3e5e4ea4ed24d86ebf884d.tar.gz
chat-e7ea080fd332ca563c3e5e4ea4ed24d86ebf884d.tar.bz2
chat-e7ea080fd332ca563c3e5e4ea4ed24d86ebf884d.zip
Fixing react warnings on permalink return
Diffstat (limited to 'webapp')
-rw-r--r--webapp/components/permalink_view.jsx11
-rw-r--r--webapp/components/posts_view.jsx1
-rw-r--r--webapp/utils/delayed_action.jsx4
3 files changed, 11 insertions, 5 deletions
diff --git a/webapp/components/permalink_view.jsx b/webapp/components/permalink_view.jsx
index 8e49019ee..2ebe52356 100644
--- a/webapp/components/permalink_view.jsx
+++ b/webapp/components/permalink_view.jsx
@@ -28,18 +28,19 @@ export default class PermalinkView extends React.Component {
const channel = ChannelStore.getCurrent();
const channelId = channel ? channel.id : '';
const channelName = channel ? channel.name : '';
- const teamURL = TeamStore.getCurrentTeamUrl();
+ const team = TeamStore.getCurrent();
+ const teamName = team ? team.name : '';
const profiles = JSON.parse(JSON.stringify(UserStore.getProfiles()));
return {
channelId,
channelName,
profiles,
- teamURL,
+ teamName,
postId
};
}
isStateValid() {
- return this.state.channelId !== '' && this.state.profiles && this.state.teamURL;
+ return this.state.channelId !== '' && this.state.profiles && this.state.teamName;
}
updateState() {
this.setState(this.getStateFromStores(this.props));
@@ -64,7 +65,7 @@ export default class PermalinkView extends React.Component {
return true;
}
- if (nextState.teamURL !== this.state.teamURL) {
+ if (nextState.teamName !== this.state.teamName) {
return true;
}
@@ -87,7 +88,7 @@ export default class PermalinkView extends React.Component {
id='archive-link-home'
>
<Link
- to={this.state.teamURL + '/channels/' + this.state.channelName}
+ to={'/' + this.state.teamName + '/channels/' + this.state.channelName}
>
<FormattedMessage
id='center_panel.recent'
diff --git a/webapp/components/posts_view.jsx b/webapp/components/posts_view.jsx
index e034a592e..647c7f086 100644
--- a/webapp/components/posts_view.jsx
+++ b/webapp/components/posts_view.jsx
@@ -384,6 +384,7 @@ export default class PostsView extends React.Component {
}
componentWillUnmount() {
window.removeEventListener('resize', this.handleResize);
+ this.scrollStopAction.cancel();
}
componentDidUpdate() {
if (this.props.postList != null) {
diff --git a/webapp/utils/delayed_action.jsx b/webapp/utils/delayed_action.jsx
index 4f6239ad0..c3b164733 100644
--- a/webapp/utils/delayed_action.jsx
+++ b/webapp/utils/delayed_action.jsx
@@ -24,4 +24,8 @@ export default class DelayedAction {
this.timer = window.setTimeout(this.fire, timeout);
}
+
+ cancel() {
+ window.clearTimeout(this.timer);
+ }
}