فهرست منبع

fix lagging on editor and release for 5.0.76

alqindiirsyam 1 روز پیش
والد
کامیت
0faf0d9c79

+ 4 - 4
AppBuilder/AppBuilder.xcodeproj/project.pbxproj

@@ -584,7 +584,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 5.0.74;
+				MARKETING_VERSION = 5.0.76;
 				PRODUCT_BUNDLE_IDENTIFIER = io.nexilis.appbuilder;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -620,7 +620,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 5.0.74;
+				MARKETING_VERSION = 5.0.76;
 				PRODUCT_BUNDLE_IDENTIFIER = io.nexilis.appbuilder;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -656,7 +656,7 @@
 					"@executable_path/../../Frameworks",
 				);
 				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
-				MARKETING_VERSION = 5.0.74;
+				MARKETING_VERSION = 5.0.76;
 				OTHER_CFLAGS = "-fstack-protector-strong";
 				PRODUCT_BUNDLE_IDENTIFIER = io.nexilis.appbuilder.AppBuilderShare;
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -695,7 +695,7 @@
 					"@executable_path/../../Frameworks",
 				);
 				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
-				MARKETING_VERSION = 5.0.74;
+				MARKETING_VERSION = 5.0.76;
 				OTHER_CFLAGS = "-fstack-protector-strong";
 				PRODUCT_BUNDLE_IDENTIFIER = io.nexilis.appbuilder.AppBuilderShare;
 				PRODUCT_NAME = "$(TARGET_NAME)";

+ 1 - 1
NexilisLite/NexilisLite/Source/Nexilis.swift

@@ -19,7 +19,7 @@ import CryptoKit
 import WebKit
 
 public class Nexilis: NSObject {
-    public static var cpaasVersion = "5.0.74"
+    public static var cpaasVersion = "5.0.76"
     public static var sAPIKey = ""
     
     public static var ADDRESS = ""

+ 9 - 17
NexilisLite/NexilisLite/Source/View/Chat/EditorPersonal.swift

@@ -3894,19 +3894,11 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
     }
     
     private func checkNewMessage(tableView: UITableView) {
-//        let indexPathFirst = tableView.indexPathsForVisibleRows?.first
-//        if indexPathFirst != nil {
-//            let dataMessages = self.dataMessages.filter({ $0["chat_date"]  as? String ?? "" == dataDates[indexPathFirst!.section] })
-//            if self.dataMessages.firstIndex(where: { $0["message_id"] as? String == dataMessages[indexPathFirst!.row]["message_id"] as? String }) == 0 && !gettingDataMessage {
-//                gettingDataMessage = true
-//                addDataMessage()
-//            }
-//        }
         currentIndexpath = tableView.indexPathsForVisibleRows?.last
         let indexFirst = tableView.indexPathsForVisibleRows?.first
         if indexFirst != nil {
-            let dataMessages = dataMessages.filter({ $0["chat_date"]  as? String ?? "" == dataDates[currentIndexpath!.section] })
-            if dataMessages.count == 0 || dataMessages.count - 1 < currentIndexpath!.row {
+            let dataMessages = dataMessages.filter({ $0["chat_date"]  as? String ?? "" == dataDates[indexFirst!.section] })
+            if dataMessages.count == 0 {
                 return
             }
             let contentHeight = tableView.contentSize.height
@@ -3935,6 +3927,9 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
 //                    headerView.isHidden = false
 //                }
 //            }
+            if dataMessages.count - 1 < currentIndexpath!.row {
+                return
+            }
             var listData = dataMessages[0...currentIndexpath!.row]
             listData = listData.filter({$0["status"] as? String != "4" && $0["status"] as? String != "8"})
             if listData.count != 0 && !isContactCenter {
@@ -3946,18 +3941,15 @@ public class EditorPersonal: UIViewController, ImageVideoPickerDelegate, UIGestu
                 }
             }
         }
-        if counter == 0 {
-            if indicatorCounterBSTB.isDescendant(of: self.view) {
-                indicatorCounterBSTB.removeConstraints(indicatorCounterBSTB.constraints)
-                indicatorCounterBSTB.removeFromSuperview()
-            }
-            updateCounter(counter: 0)
+        if counter == 0 && indicatorCounterBSTB.isDescendant(of: self.view) {
+            indicatorCounterBSTB.removeConstraints(indicatorCounterBSTB.constraints)
+            indicatorCounterBSTB.removeFromSuperview()
         } else if counter != 0 && currentIndexpath != nil {
             let dataFilter = dataMessages.filter({ $0["chat_date"]  as? String ?? "" == dataDates[currentIndexpath!.section] })
             if dataFilter.count == 0 {
                 return
             }
-            let idx = dataMessages.firstIndex(where: { $0["message_id"] as? String == dataFilter[currentIndexpath!.row]["message_id"] as? String})
+            let idx = dataMessages.firstIndex(where: { $0["message_id"]  as? String ?? "" == dataFilter[currentIndexpath!.row]["message_id"]  as? String ?? ""})
             if idx == nil {
                 return
             }