alqindiirsyam há 1 ano atrás
pai
commit
c4f1e9ac6a
1 ficheiros alterados com 11 adições e 9 exclusões
  1. 11 9
      appbuilder-ios/AppBuilder/AppBuilder/ViewController.swift

+ 11 - 9
appbuilder-ios/AppBuilder/AppBuilder/ViewController.swift

@@ -204,6 +204,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
         if((cpaasMode == PrefsUtil.CPAAS_MODE_DOCKED || cpaasMode == PrefsUtil.CPAAS_MODE_MIX)){
             createMidFloatingButton()
             navigationController?.setNavigationBarHidden(true, animated: false)
+            ViewController.pullActionButton()
         }
 //        if((cpaasMode == PrefsUtil.CPAAS_MODE_FLOATING || cpaasMode == PrefsUtil.CPAAS_MODE_MIX)) {
 //            let rect = CGRect(x: self.view.bounds.width - 100, y: self.view.bounds.height / 2, width: 50, height: 250)
@@ -226,6 +227,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
         center.addObserver(self, selector: #selector(checkCounter), name: NSNotification.Name(rawValue: Nexilis.listenerReceiveChat), object: nil)
         center.addObserver(self, selector: #selector(checkCounter), name: NSNotification.Name(rawValue: "reloadTabChats"), object: nil)
         checkCounter()
+        willappear()
     }
     
     static func getiPhoneModel() -> String {
@@ -599,6 +601,14 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
     }
     
     override func viewWillAppear(_ animated: Bool) {
+        if !firstLoad {
+            willappear()
+        } else {
+            firstLoad = false
+        }
+    }
+    
+    func willappear() {
         let acceptTerm = PrefsUtil.getTerms()
         let enable_privacy_policy = PrefsUtil.getEnablePrivacyPolicy()
         if !acceptTerm {
@@ -628,15 +638,7 @@ class ViewController: UITabBarController, UITabBarControllerDelegate, SettingMAB
                 return
             }
         }
-        if firstLoad {
-            firstLoad = false
-            if PrefsUtil.getCpaasMode() == PrefsUtil.CPAAS_MODE_DOCKED {
-                ViewController.pullActionButton()
-            }
-            self.selectedViewController?.viewWillAppear(false)
-        } else {
-            self.selectedViewController?.viewWillAppear(false)
-        }
+        self.selectedViewController?.viewWillAppear(false)
     }
     
     func showPrivacyPolicyView() {