Use constant (IOS-192)

This commit is contained in:
Nathan Mattes 2024-02-19 12:06:10 +01:00
parent 52f5458364
commit 49af28eeba
3 changed files with 7 additions and 3 deletions

View File

@ -11,6 +11,7 @@ import CoreData
import CoreDataStack
import Pageboy
import MastodonCore
import MastodonSDK
protocol MediaPreviewPage: UIViewController {
func setShowingChrome(_ showingChrome: Bool)
@ -152,7 +153,7 @@ extension MediaPreviewViewModel {
case .profileBanner(let item):
guard let assertURL = item.assetURL else { return false }
return assertURL.hasSuffix("missing.png") == false
return assertURL.hasSuffix(Mastodon.Entity.Account.missingImageName) == false
}
}
}

View File

@ -105,7 +105,6 @@ final class ProfileHeaderViewController: UIViewController, NeedsDependency, Medi
override func viewDidLoad() {
super.viewDidLoad()
view.setContentHuggingPriority(.required - 1, for: .vertical)
view.backgroundColor = .systemBackground

View File

@ -144,7 +144,7 @@ extension Mastodon.Entity.Account {
}
public func avatarImageURLWithFallback(domain: String) -> URL {
return avatarImageURL() ?? URL(string: "https://\(domain)/avatars/original/missing.png")!
return avatarImageURL() ?? URL(string: "https://\(domain)/avatars/original/\(Self.missingImageName)")!
}
public var displayNameWithFallback: String {
@ -163,3 +163,7 @@ extension Mastodon.Entity.Account {
}
}
extension Mastodon.Entity.Account {
public static let missingImageName = "missing.png"
}