Revert "display loading screen when changing team" (#5403)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
247ac8d1cc
Коммит
86a92f8c75
@@ -70,9 +70,7 @@ export default class ChannelView extends React.Component {
|
|||||||
<ChannelHeader
|
<ChannelHeader
|
||||||
channelId={this.state.channelId}
|
channelId={this.state.channelId}
|
||||||
/>
|
/>
|
||||||
<PostViewCache
|
<PostViewCache/>
|
||||||
channelId={this.state.channelId}
|
|
||||||
/>
|
|
||||||
<div
|
<div
|
||||||
className='post-create__container'
|
className='post-create__container'
|
||||||
id='post-create'
|
id='post-create'
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
// See License.txt for license information
|
// See License.txt for license information
|
||||||
|
|
||||||
import PostViewController from './post_view_controller.jsx';
|
import PostViewController from './post_view_controller.jsx';
|
||||||
import LoadingScreen from 'components/loading_screen.jsx';
|
|
||||||
|
|
||||||
import ChannelStore from 'stores/channel_store.jsx';
|
import ChannelStore from 'stores/channel_store.jsx';
|
||||||
import UserStore from 'stores/user_store.jsx';
|
import UserStore from 'stores/user_store.jsx';
|
||||||
@@ -68,45 +67,25 @@ export default class PostViewCache extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps) {
|
|
||||||
return Boolean(nextProps.channelId);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const channels = this.state.channels;
|
const channels = this.state.channels;
|
||||||
const currentChannelId = this.state.currentChannelId;
|
const currentChannelId = this.state.currentChannelId;
|
||||||
const valid = this.props.channelId === this.state.currentChannelId;
|
|
||||||
const postViews = [];
|
|
||||||
let content;
|
|
||||||
|
|
||||||
if (valid) {
|
const postViews = [];
|
||||||
for (let i = 0; i < channels.length; i++) {
|
for (let i = 0; i < channels.length; i++) {
|
||||||
postViews.push(
|
postViews.push(
|
||||||
<PostViewController
|
<PostViewController
|
||||||
key={'postviewcontroller_' + channels[i].id}
|
key={'postviewcontroller_' + channels[i].id}
|
||||||
channel={channels[i]}
|
channel={channels[i]}
|
||||||
active={channels[i].id === currentChannelId}
|
active={channels[i].id === currentChannelId}
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
content = postViews;
|
|
||||||
} else {
|
|
||||||
content = (
|
|
||||||
<LoadingScreen
|
|
||||||
position='absolute'
|
|
||||||
key='loading'
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id='post-list'>
|
<div id='post-list'>
|
||||||
{content}
|
{postViews}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PostViewCache.propTypes = {
|
|
||||||
channelId: React.PropTypes.string.isRequired
|
|
||||||
};
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user