Przeglądaj źródła

update fix force close copy when cc message

alqindiirsyam 7 miesięcy temu
rodzic
commit
f93ccd16ee

+ 1 - 15
NexilisLite/NexilisLite/Source/FloatingButton/FloatingButton.swift

@@ -651,21 +651,7 @@ public class FloatingButton: UIView {
             if mySettingDelegate != nil {
                 mySettingDelegate?.settingDelegate()
             } else {
-                let navigationController = AppStoryBoard.Palio.instance.instantiateViewController(withIdentifier: "settingNav") as! UINavigationController
-                let vc = navigationController.rootViewController as! SettingTableViewController
-                vc.fromAPI = true
-                Utils.addBackground(view: navigationController.view)
-                navigationController.modalPresentationStyle = .fullScreen
-                navigationController.navigationBar.tintColor = .white
-                navigationController.navigationBar.barTintColor = self.traitCollection.userInterfaceStyle == .dark ? .blackDarkMode : .mainColor
-                navigationController.navigationBar.isTranslucent = false
-                navigationController.navigationBar.overrideUserInterfaceStyle = .dark
-                navigationController.navigationBar.barStyle = .black
-                let cancelButtonAttributes: [NSAttributedString.Key: Any] = [NSAttributedString.Key.foregroundColor: UIColor.white, NSAttributedString.Key.font : UIFont.systemFont(ofSize: 16)]
-                UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes, for: .normal)
-                let textAttributes = [NSAttributedString.Key.foregroundColor:UIColor.white]
-                navigationController.navigationBar.titleTextAttributes = textAttributes
-                UIApplication.shared.rootViewController?.present(navigationController, animated: true, completion: nil)
+                APIS.openSetting()
             }
             hideButton()
         }

+ 4 - 4
NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -4004,7 +4004,7 @@ extension EditorPersonal: UIContextMenuInteractionDelegate {
                     }
                 })
             }
-            let data = self.dataMessages.filter({ $0["isSelected"] as! Bool == true })
+            let data = self.dataMessages.filter({ $0["isSelected"] as? Bool == true })
             for i in 0..<data.count {
                 let idx = self.dataMessages.firstIndex(where: { $0["message_id"] as? String == data[i]["message_id"] as? String})
                 if idx != nil{
@@ -4066,7 +4066,7 @@ extension EditorPersonal: UIContextMenuInteractionDelegate {
                 title.centerXAnchor.constraint(equalTo: container.centerXAnchor),
                 title.centerYAnchor.constraint(equalTo:container.centerYAnchor),
             ])
-            let countSelected = dataMessages.filter({ $0["isSelected"] as! Bool == true }).count
+            let countSelected = dataMessages.filter({ $0["isSelected"] as? Bool == true }).count
             title.text = "\(countSelected) " + "Selected".localized()
             title.textColor = .mainColor
             title.font = UIFont.systemFont(ofSize: 15.0).bold
@@ -4106,7 +4106,7 @@ extension EditorPersonal: UIContextMenuInteractionDelegate {
             button.isUserInteractionEnabled = true
             button.addGestureRecognizer(buttonGesture)
             
-            let selectedMessage = dataMessages.filter({ $0["isSelected"] as! Bool == true })
+            let selectedMessage = dataMessages.filter({ $0["isSelected"] as? Bool == true })
             if selectedMessage.count > 0 {
                 for i in 0..<selectedMessage.count {
                     if let isGroupingImages = groupImages[selectedMessage[i]["message_id"] as! String] {
@@ -4169,7 +4169,7 @@ extension EditorPersonal: UIContextMenuInteractionDelegate {
     
     @objc func sessionAction() {
         if copySession {
-            let dataMessages = self.dataMessages.filter({ $0["isSelected"] as! Bool == true })
+            let dataMessages = self.dataMessages.filter({ $0["isSelected"] as? Bool == true })
             let countSelected = dataMessages.count
             if countSelected == 0 {
                 return

+ 0 - 3
NexilisLite/NexilisLite/Source/View/Control/SettingTableViewController.swift

@@ -105,9 +105,6 @@ public class SettingTableViewController: UITableViewController, UIGestureRecogni
                 Item(icon: UIImage(systemName: "textformat.abc"), title: "Change Language".localized()),
                 Item(icon: UIImage(systemName: "arrow.up.and.person.rectangle.portrait"), title: "Sign-Up/Sign-In".localized()),
             ]
-            if Nexilis.showButtonFB {
-                Item.menus["Personal"]?.append(Item(icon: UIImage(systemName: "gearshape.circle"), title: "Configure Floating Button".localized()))
-            }
         } else {
             Database.shared.database?.inTransaction({ fmdb, rollback in
                 do {