Public rooms search: Do not open directory page if the result count is 0 or if the data source is fetching data

This commit is contained in:
manuroe
2015-12-21 11:31:30 +01:00
parent 342d17e3cc
commit b9b5372d63
3 changed files with 10 additions and 0 deletions
@@ -28,6 +28,7 @@
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *descriptionLabel;
@property (weak, nonatomic) IBOutlet UIImageView *chevronImageView;
/**
Update the information displayed by the cell.
@@ -24,6 +24,9 @@
- (void)render:(PublicRoomsDirectoryDataSource *)publicRoomsDirectoryDataSource
{
self.userInteractionEnabled = NO;
self.chevronImageView.hidden = YES;
// Show information according to the data source state
switch (publicRoomsDirectoryDataSource.state)
{
@@ -38,6 +41,11 @@
publicRoomsDirectoryDataSource.filteredRooms.count,
publicRoomsDirectoryDataSource.filter];
if (publicRoomsDirectoryDataSource.filteredRooms.count)
{
self.userInteractionEnabled = YES;
self.chevronImageView.hidden = NO;
}
break;
case MXKDataSourceStateFailed:
@@ -64,6 +64,7 @@
</tableViewCellContentView>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections>
<outlet property="chevronImageView" destination="Xgp-JV-bm1" id="tU6-gd-lAX"/>
<outlet property="descriptionLabel" destination="dQt-mN-T6b" id="XON-GW-a6T"/>
<outlet property="titleLabel" destination="Lg1-xQ-AGn" id="uqU-hH-KT0"/>
</connections>