Fix warnings (IOS-192)

This commit is contained in:
Nathan Mattes 2023-12-28 23:07:38 +01:00
parent f241232972
commit c0e08c4482
5 changed files with 7 additions and 7 deletions

View File

@ -316,9 +316,9 @@ extension ProfileCardView {
buttonState = .none
} else if relationship.following {
buttonState = .unfollow
} else if relationship.blocking || (relationship.domainBlocking ?? false) {
} else if relationship.blocking || relationship.domainBlocking {
buttonState = .blocked
} else if relationship.requested ?? false {
} else if relationship.requested {
buttonState = .pending
} else {
buttonState = .follow

View File

@ -133,7 +133,7 @@ extension ProfileHeaderView.ViewModel {
.compactMap { relationship in
guard let relationship else { return false }
return relationship.blocking || (relationship.blockedBy ?? false)
return relationship.blocking || relationship.blockedBy
}
.sink { needsImageOverlayBlurred in
UIView.animate(withDuration: 0.33) {

View File

@ -420,14 +420,14 @@ extension ProfileViewController {
let name = user.displayNameWithFallback
var menuActions: [MastodonMenu.Action] = [
.muteUser(.init(name: name, isMuting: relationship.muting ?? false)),
.muteUser(.init(name: name, isMuting: relationship.muting)),
.blockUser(.init(name: name, isBlocking: relationship.blocking)),
.reportUser(.init(name: name)),
.shareUser(.init(name: name)),
]
if relationship.following {
let showReblogs = relationship.showingReblogs ?? false// me.showingReblogsBy.contains(user)
let showReblogs = relationship.showingReblogs// me.showingReblogsBy.contains(user)
let context = MastodonMenu.HideReblogsActionContext(showReblogs: showReblogs)
menuActions.insert(.hideReblogs(context), at: 1)
}

View File

@ -62,7 +62,7 @@ extension SearchResultViewController {
switch item {
case .account(let account, relationship: _):
await DataSourceFacade.coordinateToProfileScene(provider: self, account: account)
DataSourceFacade.coordinateToProfileScene(provider: self, account: account)
case .status(let status):
await DataSourceFacade.coordinateToStatusThreadScene(
provider: self,

View File

@ -40,7 +40,7 @@ extension APIService {
let response: Mastodon.Response.Content<Mastodon.Entity.Relationship>
if relationship.following || (relationship.requested ?? false) {
if relationship.following || relationship.requested {
// unfollow
response = try await Mastodon.API.Account.unfollow(
session: session,