Fix: Room directory: "No public rooms available" is displayed while loading

#1336
This commit is contained in:
manuroe 2017-06-21 15:58:37 +02:00
parent 751544181d
commit 3787c00419

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;