From f177cff44570ebb4d109473dba2cd89009c1a8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charle=CC=80ne=20Hoareau?= Date: Tue, 26 Mar 2024 08:52:55 +0100 Subject: [PATCH 1/3] chore: Previews fixed --- Mail/Views/New Message/ComposeMessageHeaderView.swift | 1 + .../New Message/Header Cells/ComposeMessageSenderMenu.swift | 1 + 2 files changed, 2 insertions(+) diff --git a/Mail/Views/New Message/ComposeMessageHeaderView.swift b/Mail/Views/New Message/ComposeMessageHeaderView.swift index 96632756b..eec0ea39a 100644 --- a/Mail/Views/New Message/ComposeMessageHeaderView.swift +++ b/Mail/Views/New Message/ComposeMessageHeaderView.swift @@ -83,4 +83,5 @@ struct ComposeMessageHeaderView: View { #Preview { ComposeMessageHeaderView(draft: Draft(), autocompletionType: .constant(nil), currentSignature: .constant(nil)) + .environmentObject(PreviewHelper.sampleMailboxManager) } diff --git a/Mail/Views/New Message/Header Cells/ComposeMessageSenderMenu.swift b/Mail/Views/New Message/Header Cells/ComposeMessageSenderMenu.swift index 514075f1e..3dafb8ba9 100644 --- a/Mail/Views/New Message/Header Cells/ComposeMessageSenderMenu.swift +++ b/Mail/Views/New Message/Header Cells/ComposeMessageSenderMenu.swift @@ -84,4 +84,5 @@ struct ComposeMessageSenderMenu: View { #Preview { ComposeMessageSenderMenu(currentSignature: .constant(nil), autocompletionType: nil, type: .from, text: "email@email.com") + .environmentObject(PreviewHelper.sampleMailboxManager) } From b538da1e6f4125eb70cd27e4d20f4911428405f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charle=CC=80ne=20Hoareau?= Date: Tue, 26 Mar 2024 08:55:52 +0100 Subject: [PATCH 2/3] fix: Display sender email on mac --- Mail/Views/New Message/Header Cells/SenderMenuCell.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mail/Views/New Message/Header Cells/SenderMenuCell.swift b/Mail/Views/New Message/Header Cells/SenderMenuCell.swift index a36de5128..3abf7b667 100644 --- a/Mail/Views/New Message/Header Cells/SenderMenuCell.swift +++ b/Mail/Views/New Message/Header Cells/SenderMenuCell.swift @@ -16,6 +16,7 @@ along with this program. If not, see . */ +import InfomaniakCore import InfomaniakCoreUI import InfomaniakDI import MailCore @@ -24,6 +25,7 @@ import SwiftUI struct SenderMenuCell: View { @LazyInjectService private var matomo: MatomoUtils + @LazyInjectService private var platformDetector: PlatformDetectable @EnvironmentObject private var draftContentManager: DraftContentManager @@ -41,7 +43,11 @@ struct SenderMenuCell: View { draftContentManager.updateSignature(with: signature) } label: { Label { - Text("\(signature.senderName) (\(signature.name))") + if !platformDetector.isMac { + Text("\(signature.senderName) (\(signature.name))") + } else { + Text("\(signature.senderEmail) (\(signature.name))") + } } icon: { if signature == currentSignature { MailResourcesAsset.check.swiftUIImage From ee71d8a66d6952afb0a5d99d61f7dae1c2e9a747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charle=CC=80ne=20Hoareau?= Date: Tue, 26 Mar 2024 10:14:28 +0100 Subject: [PATCH 3/3] fix: Add senderEmailIdn --- Mail/Views/New Message/Header Cells/SenderMenuCell.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mail/Views/New Message/Header Cells/SenderMenuCell.swift b/Mail/Views/New Message/Header Cells/SenderMenuCell.swift index 3abf7b667..1f9d2e21e 100644 --- a/Mail/Views/New Message/Header Cells/SenderMenuCell.swift +++ b/Mail/Views/New Message/Header Cells/SenderMenuCell.swift @@ -43,10 +43,10 @@ struct SenderMenuCell: View { draftContentManager.updateSignature(with: signature) } label: { Label { - if !platformDetector.isMac { - Text("\(signature.senderName) (\(signature.name))") + if platformDetector.isMac { + Text("\(signature.senderName) (\(signature.name)) \(signature.senderEmailIdn)") } else { - Text("\(signature.senderEmail) (\(signature.name))") + Text("\(signature.senderName) (\(signature.name))") } } icon: { if signature == currentSignature {