Fall back to placeholder logo
This commit is contained in:
parent
4a659b8f8d
commit
d302e504df
|
@ -187,8 +187,12 @@ extension MFMailComposeViewController {
|
|||
|
||||
// FIXME: load from index JSON
|
||||
extension Infrastructure.Metadata {
|
||||
var logo: UIImage {
|
||||
return ImageAsset(name: name.lowercased()).image
|
||||
var logo: UIImage? {
|
||||
let bundle = Bundle(for: AppDelegate.self)
|
||||
guard let image = AssetImageTypeAlias(named: name.lowercased(), in: bundle, compatibleWith: nil) else {
|
||||
return Asset.Providers.placeholder.image
|
||||
}
|
||||
return image
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -474,13 +474,9 @@ extension OrganizerViewController {
|
|||
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
|
||||
let rowProfile = profileKey(at: indexPath)
|
||||
if rowProfile.context == .provider {
|
||||
if let metadata = InfrastructureFactory.shared.metadata(forName: rowProfile.id) {
|
||||
cell.imageView?.image = metadata.logo
|
||||
cell.leftText = metadata.description
|
||||
} else {
|
||||
cell.imageView?.image = Asset.Providers.placeholder.image
|
||||
cell.leftText = rowProfile.id
|
||||
}
|
||||
let metadata = InfrastructureFactory.shared.metadata(forName: rowProfile.id)
|
||||
cell.imageView?.image = metadata?.logo
|
||||
cell.leftText = metadata?.description ?? rowProfile.id
|
||||
} else {
|
||||
cell.imageView?.image = nil
|
||||
cell.leftText = rowProfile.id
|
||||
|
|
Loading…
Reference in New Issue