Prevent app grid from populating with empty cells during server info polling

This commit is contained in:
Cameron Gutman
2019-11-03 14:40:32 -08:00
parent 72af5d5217
commit 2ae7fefc0c

View File

@@ -259,6 +259,7 @@ static NSMutableSet* hostList;
[_appManager stopRetrieving]; [_appManager stopRetrieving];
_selectedHost = nil; _selectedHost = nil;
_sortedAppList = nil;
self.title = @"Select Host"; self.title = @"Select Host";
[self disableUpButton]; [self disableUpButton];
@@ -1137,8 +1138,8 @@ static NSMutableSet* hostList;
} }
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
if (_selectedHost != nil) { if (_selectedHost != nil && _sortedAppList != nil) {
return _selectedHost.appList.count; return _sortedAppList.count;
} }
else { else {
return 0; return 0;