Skip to content

Commit

Permalink
Update CommunityModel+SwipeActions.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjmarf committed Jan 4, 2024
1 parent c80ca8f commit 25de15e
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Mlem/Models/Content/Community/CommunityModel+SwipeActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,10 @@ extension CommunityModel {
let subscribeAction = try? subscribeSwipeAction(callback, confirmDestructive: confirmDestructive)
let favoriteAction = favoriteSwipeAction(callback, confirmDestructive: confirmDestructive)

if !self.favorited {
if let subscribeAction {
trailingActions.append(subscribeAction)
}
trailingActions.append(favoriteAction)
} else {
trailingActions.append(favoriteAction)
if let subscribeAction {
trailingActions.append(subscribeAction)
}
if let subscribeAction {
trailingActions.append(subscribeAction)
}
trailingActions.append(favoriteAction)

return SwipeConfiguration(leadingActions: [], trailingActions: trailingActions)
}
Expand Down

0 comments on commit 25de15e

Please sign in to comment.