Skip to content

Commit

Permalink
Attempt to fix icons bugging out
Browse files Browse the repository at this point in the history
  • Loading branch information
opa334 committed Jan 12, 2024
1 parent f5a2dfa commit b6579c6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions TrollStore/TSAppTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,15 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.imageView.image = _placeholderIcon;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
{
//usleep(1000 * 5000); // (test delay for debugging)
UIImage* iconImage = imageWithSize([UIImage _applicationIconImageForBundleIdentifier:appId format:iconFormatToUse() scale:[UIScreen mainScreen].scale], _placeholderIcon.size);
_cachedIcons[appId] = iconImage;
dispatch_async(dispatch_get_main_queue(), ^{
if([tableView.indexPathsForVisibleRows containsObject:indexPath])
NSIndexPath *curIndexPath = [NSIndexPath indexPathForRow:[_cachedAppInfos indexOfObject:appInfo] inSection:0];
if([tableView.indexPathsForVisibleRows containsObject:curIndexPath])
{
cell.imageView.image = iconImage;
[cell setNeedsLayout];
UITableViewCell *curCell = [tableView cellForRowAtIndexPath:curIndexPath];
curCell.imageView.image = iconImage;
[curCell setNeedsLayout];
}
});
});
Expand Down

0 comments on commit b6579c6

Please sign in to comment.