Commit 8bd4b344 authored by Oliver Wiese's avatar Oliver Wiese

link new read view with other views

parent 44525a89
......@@ -202,7 +202,12 @@ class FolderViewController: UITableViewController {
performSegue(withIdentifier: "showInboxSegue", sender: nil)
}
} else if sectionType(indexPath) == .mails {
performSegue(withIdentifier: "readFolderMailSegue", sender: getMails()[indexPath.row])
let mail = getMails()[indexPath.row]
if AppDelegate.getAppDelegate().newReadView, let coord = AppDelegate.getAppDelegate().readViewCoordinator {
coord.pushReadView(mail: mail)
return
}
performSegue(withIdentifier: "readFolderMailSegue", sender: mail)
} else {
let vc = storyboard?.instantiateViewController(withIdentifier: "folderViewController") as! FolderViewController
vc.folders = []
......
......@@ -316,6 +316,10 @@ extension KeyViewController: UITableViewDataSource {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "firstMail" {
if let mail = record?.key?.firstMail {
if AppDelegate.getAppDelegate().newReadView, let coord = AppDelegate.getAppDelegate().readViewCoordinator {
coord.pushReadView(mail: mail)
return
}
let DestinationViewController: ReadViewController = segue.destination as! ReadViewController
DestinationViewController.mail = mail
}
......
......@@ -242,6 +242,10 @@ class ListViewController: UITableViewController {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "readMailSegue" {
if let mail = sender as? PersistentMail {
if AppDelegate.getAppDelegate().newReadView, let coord = AppDelegate.getAppDelegate().readViewCoordinator {
coord.pushReadView(mail: mail)
return
}
let DestinationViewController: ReadViewController = segue.destination as! ReadViewController
DestinationViewController.mail = mail
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment