Merge pull request #1339 from vector-im/riot_1336

Room directory: "No public rooms available" bug fixes
This commit is contained in:
manuroe 2017-06-22 10:01:35 +02:00 committed by GitHub
commit 589d7e7d4a
2 changed files with 22 additions and 5 deletions

View file

@ -214,6 +214,10 @@ double const kPublicRoomsDirectoryDataExpiration = 10;
{
if (_hasReachedPaginationEnd)
{
if (complete)
{
complete(0);
}
return nil;
}
@ -338,14 +342,22 @@ double const kPublicRoomsDirectoryDataExpiration = 10;
tableViewCell.textLabel.font = [UIFont systemFontOfSize:15.0];
tableViewCell.selectionStyle = UITableViewCellSelectionStyleNone;
}
if (_searchPattern.length)
if (state == MXKDataSourceStateReady)
{
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"search_no_result", @"Vector", nil);
if (_searchPattern.length)
{
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"search_no_result", @"Vector", nil);
}
else
{
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"room_directory_no_public_room", @"Vector", nil);
}
}
else
{
tableViewCell.textLabel.text = NSLocalizedStringFromTable(@"room_directory_no_public_room", @"Vector", nil);
// Show nothing while loading and in other cases
tableViewCell.textLabel.text = @"";
}
return tableViewCell;

View file

@ -210,7 +210,12 @@
{
if (indexPath.section == recentsDataSource.directorySection)
{
[self openPublicRoomAtIndexPath:indexPath];
// Sanity check
MXPublicRoom *publicRoom = [recentsDataSource.publicRoomsDirectoryDataSource roomAtIndexPath:indexPath];
if (publicRoom)
{
[self openPublicRoomAtIndexPath:indexPath];
}
}
else
{