summaryrefslogtreecommitdiffstats
path: root/webapp/components/needs_team.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/needs_team.jsx')
-rw-r--r--webapp/components/needs_team.jsx16
1 files changed, 15 insertions, 1 deletions
diff --git a/webapp/components/needs_team.jsx b/webapp/components/needs_team.jsx
index 5cb714ebc..11e75bfb7 100644
--- a/webapp/components/needs_team.jsx
+++ b/webapp/components/needs_team.jsx
@@ -12,6 +12,7 @@ import TeamStore from 'stores/team_store.jsx';
import UserStore from 'stores/user_store.jsx';
import PreferenceStore from 'stores/preference_store.jsx';
import ChannelStore from 'stores/channel_store.jsx';
+import PostStore from 'stores/post_store.jsx';
import * as GlobalActions from 'actions/global_actions.jsx';
import {startPeriodicStatusUpdates, stopPeriodicStatusUpdates} from 'actions/status_actions.jsx';
import {startPeriodicSync, stopPeriodicSync} from 'actions/websocket_actions.jsx';
@@ -177,12 +178,25 @@ export default class NeedsTeam extends React.Component {
</div>
);
}
+
+ let channel = ChannelStore.getByName(this.props.params.channel);
+ if (channel == null) {
+ // the permalink view is not really tied to a particular channel but still needs it
+ const postId = PostStore.getFocusedPostId();
+ const post = PostStore.getEarliestPostFromPage(postId);
+
+ // the post take some time before being available on page load
+ if (post != null) {
+ channel = ChannelStore.get(post.channel_id);
+ }
+ }
+
return (
<div className='channel-view'>
<ErrorBar/>
<WebrtcNotification/>
<div className='container-fluid'>
- <SidebarRight/>
+ <SidebarRight channel={channel}/>
<SidebarRightMenu teamType={this.state.team.type}/>
<WebrtcSidebar/>
{content}