mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
Shows app’s source icon on AppBannerView
Excluding contexts where it is redundant (e.g. source detail page).
This commit is contained in:
@@ -226,11 +226,12 @@ private extension SourceDetailContentViewController
|
||||
cell.contentView.backgroundColor = .altBackground
|
||||
|
||||
cell.bannerView.button.isIndicatingActivity = false
|
||||
cell.bannerView.configure(for: storeApp)
|
||||
cell.bannerView.configure(for: storeApp, showSourceIcon: false)
|
||||
|
||||
cell.bannerView.button.tintColor = storeApp.tintColor
|
||||
cell.bannerView.button.addTarget(self, action: #selector(SourceDetailContentViewController.performAppAction(_:)), for: .primaryActionTriggered)
|
||||
|
||||
cell.bannerView.iconImageView.image = nil
|
||||
cell.bannerView.iconImageView.isIndicatingActivity = true
|
||||
}
|
||||
dataSource.prefetchHandler = { (storeApp, indexPath, completion) -> Foundation.Operation? in
|
||||
@@ -248,14 +249,15 @@ private extension SourceDetailContentViewController
|
||||
}
|
||||
}
|
||||
}
|
||||
dataSource.prefetchCompletionHandler = { (cell, image, indexPath, error) in
|
||||
dataSource.prefetchCompletionHandler = { [weak dataSource] (cell, image, indexPath, error) in
|
||||
let cell = cell as! AppBannerCollectionViewCell
|
||||
cell.bannerView.iconImageView.image = image
|
||||
cell.bannerView.iconImageView.isIndicatingActivity = false
|
||||
|
||||
if let error
|
||||
if let error, let dataSource
|
||||
{
|
||||
print("[ALTLog] Error loading source icon:", error)
|
||||
let app = dataSource.item(at: indexPath)
|
||||
Logger.main.debug("Failed to fetch app icon from \(app.iconURL, privacy: .public). \(error.localizedDescription, privacy: .public)")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user