Fix build

This commit is contained in:
Nathan Mattes 2024-02-19 12:05:34 +01:00
parent ed7de63eb7
commit 52f5458364
6 changed files with 9 additions and 9 deletions

View File

@ -27,7 +27,7 @@ extension DataSourceFacade {
) )
let userInfo = [ let userInfo = [
.relationship: response.value, UserInfoKey.relationship: response.value,
] ]
NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo) NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo)

View File

@ -27,7 +27,7 @@ extension DataSourceFacade {
dependency.context.authenticationService.fetchFollowingAndBlockedAsync() dependency.context.authenticationService.fetchFollowingAndBlockedAsync()
NotificationCenter.default.post(name: .relationshipChanged, object: nil, userInfo: [ NotificationCenter.default.post(name: .relationshipChanged, object: nil, userInfo: [
.relationship: response UserInfoKey.relationship: response
]) ])
return response return response
@ -75,7 +75,7 @@ extension DataSourceFacade {
} }
NotificationCenter.default.post(name: .relationshipChanged, object: nil, userInfo: [ NotificationCenter.default.post(name: .relationshipChanged, object: nil, userInfo: [
.relationship: newRelationship UserInfoKey.relationship: newRelationship
]) ])
await notificationView.configure(notification: notification, authenticationBox: dependency.authContext.mastodonAuthenticationBox) await notificationView.configure(notification: notification, authenticationBox: dependency.authContext.mastodonAuthenticationBox)
@ -115,7 +115,7 @@ extension DataSourceFacade {
) )
let userInfo = [ let userInfo = [
.relationship: newRelationship, UserInfoKey.relationship: newRelationship,
] ]
NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo) NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo)

View File

@ -23,7 +23,7 @@ extension DataSourceFacade {
) )
let userInfo = [ let userInfo = [
.relationship: response.value, UserInfoKey.relationship: response.value,
] ]
NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo) NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo)

View File

@ -57,7 +57,7 @@ extension ProfileCardView.ViewModel {
private func bindHeader(view: ProfileCardView) { private func bindHeader(view: ProfileCardView) {
$authorBannerImageURL $authorBannerImageURL
.sink { url in .sink { url in
guard let url = url, !url.absoluteString.hasSuffix("missing.png") else { guard let url = url, !url.absoluteString.hasSuffix(Mastodon.Entity.Account.missingImageName) else {
view.bannerImageView.image = .placeholder(color: .systemGray3) view.bannerImageView.image = .placeholder(color: .systemGray3)
return return
} }

View File

@ -833,7 +833,7 @@ extension ProfileViewController: ProfileHeaderViewControllerDelegate {
// we need to trigger this here as domain block doesn't return a relationship // we need to trigger this here as domain block doesn't return a relationship
let userInfo = [ let userInfo = [
.relationship: newRelationship, UserInfoKey.relationship: newRelationship,
] ]
NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo) NotificationCenter.default.post(name: .relationshipChanged, object: self, userInfo: userInfo)
@ -1002,7 +1002,7 @@ extension ProfileViewController {
@objc @objc
func relationshipChanged(_ notification: Notification) { func relationshipChanged(_ notification: Notification) {
guard let userInfo = notification.userInfo, let relationship = userInfo[.relationship] as? Mastodon.Entity.Relationship else { guard let userInfo = notification.userInfo, let relationship = userInfo[UserInfoKey.relationship] as? Mastodon.Entity.Relationship else {
return return
} }

View File

@ -15,7 +15,7 @@ extension Notification.Name {
public static let relationshipChanged = Notification.Name(rawValue: "org.joinmastodon.app.relationship-changed") public static let relationshipChanged = Notification.Name(rawValue: "org.joinmastodon.app.relationship-changed")
} }
extension AnyHashable { public enum UserInfoKey {
public static let relationship = "relationship" public static let relationship = "relationship"
} }