Skip to content

Commit

Permalink
feat: Several mails actions
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinperignon committed Jul 17, 2023
1 parent 14b3eea commit 934b582
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Mail/Views/Bottom sheets/Actions/ActionsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,14 @@ enum ActionsTarget: Equatable, Identifiable {
switch target {
case .threads(let threads, _):
if threads.count > 1 {
let spam = threads.allSatisfy { $0.folder?.role == .spam }
let unread = threads.allSatisfy(\.hasUnseenMessages)
quickActions = [.move, .archive, spam ? .nonSpam : .spam, .delete]
quickActions = [.move, unread ? .markAsRead : .markAsUnread, .archive, .delete]

let spam = threads.allSatisfy { $0.folder?.role == .spam }
let star = threads.allSatisfy(\.flagged)
listActions = [
unread ? .markAsRead : .markAsUnread
spam ? .nonSpam : .spam,
star ? .unstar : .star
]
} else if let thread = threads.first {
quickActions = Action.quickActions
Expand Down

0 comments on commit 934b582

Please sign in to comment.