Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MultiSelect): Add alert in draft folder #670

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Mail/Views/Thread List/FlushFolderAlertView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ struct FlushFolderAlertView: View {
}

switch folder?.role {
case .trash:
return MailResourcesStrings.Localizable.threadListEmptyTrashButton
case .spam:
return MailResourcesStrings.Localizable.threadListEmptySpamButton
case .trash:
return MailResourcesStrings.Localizable.threadListEmptyTrashButton
default:
return ""
}
Expand Down
4 changes: 2 additions & 2 deletions Mail/Views/Thread List/FlushFolderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import SwiftUI

struct FlushFolderView: View {
private static let labels: [FolderRole: String] = [
.trash: MailResourcesStrings.Localizable.threadListTrashHint,
.spam: MailResourcesStrings.Localizable.threadListSpamHint
.spam: MailResourcesStrings.Localizable.threadListSpamHint,
.trash: MailResourcesStrings.Localizable.threadListTrashHint
]
private static let buttons: [FolderRole: String] = [
.trash: MailResourcesStrings.Localizable.threadListEmptyTrashButton,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ import SwiftUI
try await mailboxManager.toggleStar(threads: Array(selectedItems))
case .delete:
let threads = Array(selectedItems)
if selectedItems.first?.folder?.role == .trash || selectedItems.first?.folder?.role == .spam {
switch selectedItems.first?.folder?.role {
case .draft, .spam, .trash:
flushAlert.wrappedValue = FlushAlertState(deletedMessages: selectedItems.count) {
await tryOrDisplayError {
try await self.mailboxManager.moveOrDelete(threads: threads)
}
}
} else {
default:
try await mailboxManager.moveOrDelete(threads: threads)
}
default:
Expand Down