@@ -608,19 +608,23 @@ extension OrderDetailsViewController: MFMessageComposeViewControllerDelegate {
608608//
609609extension OrderDetailsViewController : MFMailComposeViewControllerDelegate {
610610 func sendEmailIfPossible( ) {
611- if MFMailComposeViewController . canSendMail ( ) {
612- guard let email = viewModel. order. billingAddress? . email else {
613- return
614- }
611+ guard let email = viewModel. order. billingAddress? . email, MFMailComposeViewController . canSendMail ( ) else {
612+ return
613+ }
615614
616- sendEmail ( to: email)
615+ sendEmail ( to: email)
617616 WooAnalytics . shared. track ( . orderContactAction, withProperties: [ " id " : viewModel. order. orderID,
618617 " status " : viewModel. order. status. rawValue,
619618 " type " : " email " ] )
620619 }
621620 }
622621
623622 private func sendEmail( to email: String ) {
623+ // Workaround: MFMailCompose isn't *FULLY* picking up UINavigationBar's WC's appearance. Title / Buttons look awful.
624+ // We're falling back to iOS's default appearance
625+ UINavigationBar . applyDefaultAppearance ( )
626+
627+ // Composer
624628 let controller = MFMailComposeViewController ( )
625629 controller. setToRecipients ( [ email] )
626630 controller. mailComposeDelegate = self
@@ -629,6 +633,9 @@ extension OrderDetailsViewController: MFMailComposeViewControllerDelegate {
629633
630634 func mailComposeController( _ controller: MFMailComposeViewController , didFinishWith result: MFMailComposeResult , error: Error ? ) {
631635 controller. dismiss ( animated: true , completion: nil )
636+
637+ // Workaround: Restore WC's navBar appearance
638+ UINavigationBar . applyWooAppearance ( )
632639 }
633640}
634641
0 commit comments