Fxing issue with permalink view and channel header (#2912)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
d3f360974b
Коммит
4f799b980f
@@ -7,8 +7,6 @@ import PostStore from 'stores/post_store.jsx';
|
|||||||
import ChannelStore from 'stores/channel_store.jsx';
|
import ChannelStore from 'stores/channel_store.jsx';
|
||||||
import * as GlobalActions from 'action_creators/global_actions.jsx';
|
import * as GlobalActions from 'action_creators/global_actions.jsx';
|
||||||
|
|
||||||
import {FormattedMessage} from 'react-intl';
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export default class PostFocusView extends React.Component {
|
export default class PostFocusView extends React.Component {
|
||||||
@@ -79,19 +77,6 @@ export default class PostFocusView extends React.Component {
|
|||||||
GlobalActions.emitLoadMorePostsFocusedBottomEvent();
|
GlobalActions.emitLoadMorePostsFocusedBottomEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
getIntroMessage() {
|
|
||||||
return (
|
|
||||||
<div className='channel-intro'>
|
|
||||||
<h4 className='channel-intro__title'>
|
|
||||||
<FormattedMessage
|
|
||||||
id='post_focus_view.beginning'
|
|
||||||
defaultMessage='Beginning of Channel Archives'
|
|
||||||
/>
|
|
||||||
</h4>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const postsToHighlight = {};
|
const postsToHighlight = {};
|
||||||
postsToHighlight[this.state.scrollPostId] = true;
|
postsToHighlight[this.state.scrollPostId] = true;
|
||||||
@@ -113,7 +98,6 @@ export default class PostFocusView extends React.Component {
|
|||||||
loadMorePostsBottomClicked={this.loadMorePostsBottom}
|
loadMorePostsBottomClicked={this.loadMorePostsBottom}
|
||||||
showMoreMessagesTop={!this.state.atTop}
|
showMoreMessagesTop={!this.state.atTop}
|
||||||
showMoreMessagesBottom={!this.state.atBottom}
|
showMoreMessagesBottom={!this.state.atBottom}
|
||||||
introText={this.getIntroMessage()}
|
|
||||||
messageSeparatorTime={0}
|
messageSeparatorTime={0}
|
||||||
postsToHighlight={postsToHighlight}
|
postsToHighlight={postsToHighlight}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ export default class PostsView extends React.Component {
|
|||||||
this.scrollStopAction = new DelayedAction(this.handleScrollStop);
|
this.scrollStopAction = new DelayedAction(this.handleScrollStop);
|
||||||
|
|
||||||
let profiles = UserStore.getProfiles();
|
let profiles = UserStore.getProfiles();
|
||||||
if (props.channel.type === Constants.DM_CHANNEL) {
|
if (props.channel && props.channel.type === Constants.DM_CHANNEL) {
|
||||||
profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
|
profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ export default class PostsView extends React.Component {
|
|||||||
}
|
}
|
||||||
onUserChange() {
|
onUserChange() {
|
||||||
let profiles = UserStore.getProfiles();
|
let profiles = UserStore.getProfiles();
|
||||||
if (this.props.channel.type === Constants.DM_CHANNEL) {
|
if (this.props.channel && this.props.channel.type === Constants.DM_CHANNEL) {
|
||||||
profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
|
profiles = Object.assign({}, profiles, UserStore.getDirectProfiles());
|
||||||
}
|
}
|
||||||
this.setState({currentUser: UserStore.getCurrentUser(), profiles: JSON.parse(JSON.stringify(profiles))});
|
this.setState({currentUser: UserStore.getCurrentUser(), profiles: JSON.parse(JSON.stringify(profiles))});
|
||||||
@@ -395,6 +395,20 @@ export default class PostsView extends React.Component {
|
|||||||
var postList = $(this.refs.postlist);
|
var postList = $(this.refs.postlist);
|
||||||
postList.animate({scrollTop: this.refs.postlist.scrollHeight}, '500');
|
postList.animate({scrollTop: this.refs.postlist.scrollHeight}, '500');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getArchivesIntroMessage() {
|
||||||
|
return (
|
||||||
|
<div className='channel-intro'>
|
||||||
|
<h4 className='channel-intro__title'>
|
||||||
|
<FormattedMessage
|
||||||
|
id='post_focus_view.beginning'
|
||||||
|
defaultMessage='Beginning of Channel Archives'
|
||||||
|
/>
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (this.props.postList != null) {
|
if (this.props.postList != null) {
|
||||||
this.updateScrolling();
|
this.updateScrolling();
|
||||||
@@ -405,7 +419,11 @@ export default class PostsView extends React.Component {
|
|||||||
UserStore.addChangeListener(this.onUserChange);
|
UserStore.addChangeListener(this.onUserChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.introText = createChannelIntroMessage(this.props.channel);
|
if (this.props.channel) {
|
||||||
|
this.introText = createChannelIntroMessage(this.props.channel);
|
||||||
|
} else {
|
||||||
|
this.introText = this.getArchivesIntroMessage();
|
||||||
|
}
|
||||||
|
|
||||||
window.addEventListener('resize', this.handleResize);
|
window.addEventListener('resize', this.handleResize);
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user