MM-11035 Add missing loading screen when the Add Members to channel screen is loading (#1853)
* Add showNoResults state to custom_list
This commit is contained in:
parent
0aab4aca18
commit
f23546ef5e
1 changed files with 10 additions and 4 deletions
|
|
@ -63,6 +63,7 @@ class ChannelAddMembers extends PureComponent {
|
|||
selectedMembers: {},
|
||||
showNoResults: false,
|
||||
term: '',
|
||||
isLoading: true,
|
||||
};
|
||||
this.addButton.title = props.intl.formatMessage({id: 'integrations.add', defaultMessage: 'Add'});
|
||||
|
||||
|
|
@ -123,6 +124,12 @@ class ChannelAddMembers extends PureComponent {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((loadMoreRequestStatus !== nextProps.loadMoreRequestStatus) || (this.props.searchRequestStatus !== nextProps.searchRequestStatus)) {
|
||||
const isLoading = (nextProps.loadMoreRequestStatus === RequestStatus.STARTED) ||
|
||||
(nextProps.searchRequestStatus === RequestStatus.STARTED);
|
||||
this.setState({isLoading});
|
||||
}
|
||||
}
|
||||
|
||||
cancelSearch = () => {
|
||||
|
|
@ -222,11 +229,9 @@ class ChannelAddMembers extends PureComponent {
|
|||
};
|
||||
|
||||
render() {
|
||||
const {intl, loadMoreRequestStatus, searchRequestStatus, preferences, theme} = this.props;
|
||||
const {intl, preferences, theme} = this.props;
|
||||
const {adding, profiles, searching, term} = this.state;
|
||||
const {formatMessage} = intl;
|
||||
const isLoading = (loadMoreRequestStatus === RequestStatus.STARTED) ||
|
||||
(searchRequestStatus === RequestStatus.STARTED);
|
||||
const style = getStyleFromTheme(theme);
|
||||
const more = searching ? () => true : this.loadMoreMembers;
|
||||
|
||||
|
|
@ -281,12 +286,13 @@ class ChannelAddMembers extends PureComponent {
|
|||
onListEndReached={more}
|
||||
preferences={preferences}
|
||||
listScrollRenderAheadDistance={50}
|
||||
loading={isLoading}
|
||||
loading={this.state.isLoading}
|
||||
loadingText={loadingText}
|
||||
selectable={this.state.canSelect}
|
||||
onRowSelect={this.handleRowSelect}
|
||||
renderRow={UserListRow}
|
||||
createSections={createMembersSections}
|
||||
showNoResults={this.state.showNoResults}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue