diff --git a/app/screens/thread/index.js b/app/screens/thread/index.js index 099c7b32a..7f1573ab0 100644 --- a/app/screens/thread/index.js +++ b/app/screens/thread/index.js @@ -28,6 +28,7 @@ function makeMapStateToProps() { postIds: getPostIdsForThread(state, ownProps.rootId), theme: getTheme(state), channelIsArchived: channel ? channel.delete_at !== 0 : false, + threadLoadingStatus: state.requests.posts.getPostThread, }; }; } diff --git a/app/screens/thread/thread.js b/app/screens/thread/thread.js index 163af06db..da2a98143 100644 --- a/app/screens/thread/thread.js +++ b/app/screens/thread/thread.js @@ -5,9 +5,9 @@ import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; import {Platform} from 'react-native'; import {injectIntl, intlShape} from 'react-intl'; +import {General, RequestStatus} from 'mattermost-redux/constants'; -import {General} from 'mattermost-redux/constants'; - +import Loading from 'app/components/loading'; import KeyboardLayout from 'app/components/layout/keyboard_layout'; import PostList from 'app/components/post_list'; import PostTextbox from 'app/components/post_textbox'; @@ -31,6 +31,7 @@ class Thread extends PureComponent { theme: PropTypes.object.isRequired, postIds: PropTypes.array.isRequired, channelIsArchived: PropTypes.bool, + threadLoadingStatus: PropTypes.object, }; state = {}; @@ -88,7 +89,7 @@ class Thread extends PureComponent { } renderFooter = () => { - if (!this.hasRootPost()) { + if (!this.hasRootPost() && this.props.threadLoadingStatus.status !== RequestStatus.STARTED) { return ( ); @@ -124,6 +125,35 @@ class Thread extends PureComponent { channelIsArchived, } = this.props; const style = getStyle(theme); + let content; + if (this.props.threadLoadingStatus.status === RequestStatus.STARTED) { + content = ( + + ); + } else { + content = ( + + ); + } + let postTextBox; + if (this.hasRootPost() && this.props.threadLoadingStatus.status !== RequestStatus.STARTED) { + postTextBox = ( + + ); + } return ( - - {this.hasRootPost() && - } + {content} + {postTextBox} );