diff options
author | Gabin Aureche <gabin.aureche@live.fr> | 2017-03-13 13:25:08 +0100 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-03-13 12:25:08 +0000 |
commit | fe38d6d5bb36e18ddefbe490cc21f48f4f4c8d81 (patch) | |
tree | b96d457cde64b7397f91028106e93a7f92a179bd /webapp/components/needs_team.jsx | |
parent | 482a0fb5fc248b1ec61db35299dc3e6d963ad5ab (diff) | |
download | chat-fe38d6d5bb36e18ddefbe490cc21f48f4f4c8d81.tar.gz chat-fe38d6d5bb36e18ddefbe490cc21f48f4f4c8d81.tar.bz2 chat-fe38d6d5bb36e18ddefbe490cc21f48f4f4c8d81.zip |
Add pinned posts (#4217)
Diffstat (limited to 'webapp/components/needs_team.jsx')
-rw-r--r-- | webapp/components/needs_team.jsx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/webapp/components/needs_team.jsx b/webapp/components/needs_team.jsx index fb6029c2b..f589136b5 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 Constants from 'utils/constants.jsx'; @@ -173,12 +174,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} |