If groupRoomsLoading, replace RoomDetailList entirely with Spinner

pull/21833/head
Luke Barnard 2017-10-31 14:21:00 +00:00
parent 775468e71a
commit d6cbc44e0f
2 changed files with 5 additions and 7 deletions

View File

@ -657,6 +657,7 @@ export default React.createClass({
const RoomDetailList = sdk.getComponent('rooms.RoomDetailList');
const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
const TintableSvg = sdk.getComponent('elements.TintableSvg');
const Spinner = sdk.getComponent('elements.Spinner');
const addRoomRow = this.state.editing ?
(<AccessibleButton className="mx_GroupView_rooms_header_addRow"
@ -674,7 +675,10 @@ export default React.createClass({
<h3>{ _t('Rooms') }</h3>
{ addRoomRow }
</div>
<RoomDetailList rooms={this.state.groupRooms} loading={this.state.groupRoomsLoading} />
{ this.state.groupRoomsLoading ?
<Spinner /> :
<RoomDetailList rooms={this.state.groupRooms} />
}
</div>;
},

View File

@ -113,8 +113,6 @@ export default React.createClass({
worldReadable: PropTypes.bool,
guestCanJoin: PropTypes.bool,
loading: PropTypes.bool,
})),
},
@ -126,10 +124,6 @@ export default React.createClass({
},
render() {
const Spinner = sdk.getComponent('elements.Spinner');
if (this.props.loading) {
return <Spinner />;
}
const rows = this.getRows();
let rooms;
if (rows.length == 0) {