From bda1cc54899988683b8e3e2ad868af6292edbd02 Mon Sep 17 00:00:00 2001
From: Oliver Wiese <oliver.wiese@fu-berlin.de>
Date: Wed, 15 Apr 2020 10:53:17 +0200
Subject: [PATCH] clean code

---
 .../SwiftUI/Read/ReadViewCoordinator.swift    | 39 +------------------
 1 file changed, 1 insertion(+), 38 deletions(-)

diff --git a/enzevalos_iphone/SwiftUI/Read/ReadViewCoordinator.swift b/enzevalos_iphone/SwiftUI/Read/ReadViewCoordinator.swift
index 573c7482..c51807cc 100644
--- a/enzevalos_iphone/SwiftUI/Read/ReadViewCoordinator.swift
+++ b/enzevalos_iphone/SwiftUI/Read/ReadViewCoordinator.swift
@@ -76,6 +76,7 @@ class ReadViewCoordinator {
         //TODO: make this work
         Logger.log(delete: mail, toTrash: true)
         AppDelegate.getAppDelegate().mailHandler.move(mails: [mail], from: mail.folder.path, to: UserManager.backendTrashFolderPath)
+        AppDelegate.getAppDelegate().presentInboxViewController()
     }
     
     func archive(mail: PersistentMail){
@@ -98,13 +99,6 @@ class ReadViewCoordinator {
         root.pushViewController(vc, animated: true)
     }
     
-    func pushExportKeyView() {
-        //TODO: make this work
-        let vc = mainStoryboard.instantiateViewController(identifier: "exportKeyFromReadView")
-        root.isToolbarHidden = false
-        root.pushViewController(vc, animated: true)
-    }
-    
     func pushContactView(contact: KeyRecord) {
         let vc = mainStoryboard.instantiateViewController(withIdentifier: ViewID.KeyRecordView.rawValue)
         if let vc = vc as? ContactViewController {
@@ -119,37 +113,6 @@ class ReadViewCoordinator {
         root.present(vc, animated: true)
     }
     
-    func setup(){
-        hideUIKitToolbar()
-        setupNavigationbar()
-    }
-    
-    func reset(){
-        animateBarColor(ThemeManager.defaultColor)
-    }
-    
-    func hideUIKitToolbar(){
-        root.isToolbarHidden = true
-    }
-    
-    func setupNavigationbar(){
-        
-        ///those dont work
-        //root.isNavigationBarHidden=true
-        //root.navigationBar.isHidden=true
-        //root.navigationBar.isTranslucent=true
-        
-        /*if mail.trouble{animateBarColor(ThemeManager.troubleMessageColor()) }
-        else{animateBarColor(mail.isSecure ? ThemeManager.encryptedMessageColor() : ThemeManager.unencryptedMessageColor())}*/
-    }
-    
-    private func animateBarColor(_ c:UIColor){
-        
-        //TODO: why desnt it work? it just jumps
-        UIView.animate(withDuration: 0.3, animations: {
-            self.root.navigationBar.barTintColor = c })
-    }
-    
     /// AskUserToImportSK, ImportSK, ImportPK, MoreInformation, ExportSK, OK, IgnoreWarning, SendPK
     func ignoreMail <M: DisplayMail> (mail: M) {
         guard let m = mail.persistentMail else {
-- 
GitLab