mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-29 12:02:11 +00:00
Use placeholder when provider logo is missing
So far it's what happens for dynamically added providers, because there is no local asset.
This commit is contained in:
parent
28a7dcdcf7
commit
1619c7f46c
@ -284,6 +284,7 @@ internal enum Asset {
|
||||
internal static let mullvad = ImageAsset(name: "mullvad")
|
||||
internal static let nordvpn = ImageAsset(name: "nordvpn")
|
||||
internal static let pia = ImageAsset(name: "pia")
|
||||
internal static let placeholder = ImageAsset(name: "placeholder")
|
||||
internal static let protonvpn = ImageAsset(name: "protonvpn")
|
||||
internal static let tunnelbear = ImageAsset(name: "tunnelbear")
|
||||
internal static let vyprvpn = ImageAsset(name: "vyprvpn")
|
||||
|
@ -191,7 +191,7 @@ extension MFMailComposeViewController {
|
||||
|
||||
// FIXME: load from index JSON
|
||||
extension Infrastructure.Metadata {
|
||||
var logo: UIImage? {
|
||||
var logo: UIImage {
|
||||
return ImageAsset(name: name.lowercased()).image
|
||||
}
|
||||
}
|
||||
|
22
Passepartout-iOS/Providers.xcassets/placeholder.imageset/Contents.json
vendored
Normal file
22
Passepartout-iOS/Providers.xcassets/placeholder.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "placeholder@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "placeholder@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
BIN
Passepartout-iOS/Providers.xcassets/placeholder.imageset/placeholder@2x.png
vendored
Normal file
BIN
Passepartout-iOS/Providers.xcassets/placeholder.imageset/placeholder@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
Passepartout-iOS/Providers.xcassets/placeholder.imageset/placeholder@3x.png
vendored
Normal file
BIN
Passepartout-iOS/Providers.xcassets/placeholder.imageset/placeholder@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
@ -473,9 +473,14 @@ extension OrganizerViewController {
|
||||
case .profile:
|
||||
let cell = Cells.setting.dequeue(from: tableView, for: indexPath)
|
||||
let rowProfile = profileKey(at: indexPath)
|
||||
if rowProfile.context == .provider, let metadata = InfrastructureFactory.shared.metadata(forName: rowProfile.id) {
|
||||
cell.imageView?.image = metadata.logo
|
||||
cell.leftText = metadata.description
|
||||
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
|
||||
}
|
||||
} else {
|
||||
cell.imageView?.image = nil
|
||||
cell.leftText = rowProfile.id
|
||||
|
Loading…
Reference in New Issue
Block a user