File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
WooCommerce/Classes/ViewRelated/Orders/OrderDetails Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -587,16 +587,19 @@ extension OrderDetailsViewController: MFMessageComposeViewControllerDelegate {
587587//
588588extension OrderDetailsViewController : MFMailComposeViewControllerDelegate {
589589 func sendEmailIfPossible( ) {
590- if MFMailComposeViewController . canSendMail ( ) {
591- guard let email = viewModel. order. billingAddress? . email else {
592- return
593- }
594-
595- sendEmail ( to: email)
590+ guard let email = viewModel. order. billingAddress? . email, MFMailComposeViewController . canSendMail ( ) else {
591+ return
596592 }
593+
594+ sendEmail ( to: email)
597595 }
598596
599597 private func sendEmail( to email: String ) {
598+ // Workaround: MFMailCompose isn't *FULLY* picking up UINavigationBar's WC's appearance. Title / Buttons look awful.
599+ // We're falling back to iOS's default appearence
600+ UINavigationBar . applyDefaultAppearance ( )
601+
602+ // Composer
600603 let controller = MFMailComposeViewController ( )
601604 controller. setToRecipients ( [ email] )
602605 controller. mailComposeDelegate = self
@@ -605,6 +608,9 @@ extension OrderDetailsViewController: MFMailComposeViewControllerDelegate {
605608
606609 func mailComposeController( _ controller: MFMailComposeViewController , didFinishWith result: MFMailComposeResult , error: Error ? ) {
607610 controller. dismiss ( animated: true , completion: nil )
611+
612+ // Workaround: Restore WC's navBar appearance
613+ UINavigationBar . applyWooAppearance ( )
608614 }
609615}
610616
You can’t perform that action at this time.
0 commit comments