alqindiirsyam há 3 anos atrás
pai
commit
f2df572e4f

+ 11 - 12
appbuilder-ios/AppBuilder/AppBuilder/FirstTabViewController.swift

@@ -67,18 +67,23 @@ class FirstTabViewController: UIViewController, WKUIDelegate, UIScrollViewDelega
         let me = UserDefaults.standard.string(forKey: "me")
         
         var myURL : URL?
+        let lang = UserDefaults.standard.string(forKey: "i18n_language")
+        var intLang = 0
+        if lang == "id" {
+            intLang = 1
+        }
         switch(ViewController.sURL){
         case "0":
-            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab1-main-only?f_pin=\(me ?? "")"
+            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab1-main-only?f_pin=\(me ?? "")&lang=\(intLang)"
             myURL = URL(string: address)
         case "1":
-            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab3-main-only?f_pin=\(me ?? "")"
+            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab3-main-only?f_pin=\(me ?? "")&lang=\(intLang)"
             myURL = URL(string: address)
         case "2":
-            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab1-main?f_pin=\(me ?? "")"
+            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab1-main?f_pin=\(me ?? "")&lang=\(intLang)"
             myURL = URL(string: address)
         case "3":
-            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab3-commerce?f_pin=\(me ?? "")"
+            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab3-commerce?f_pin=\(me ?? "")&lang=\(intLang)"
             myURL = URL(string: address)
         default:
             if(!ViewController.sURL.isEmpty){
@@ -94,12 +99,6 @@ class FirstTabViewController: UIViewController, WKUIDelegate, UIScrollViewDelega
         }
         if let u = myURL {
             if dateRefresh == nil || Int(Date().timeIntervalSince(dateRefresh!)) >= 60 || FirstTabViewController.forceRefresh {
-                let lang = UserDefaults.standard.string(forKey: "i18n_language")
-                var intLang = 0
-                if lang == "id" {
-                    intLang = 1
-                }
-                self.webView.evaluateJavaScript("{window.localStorage.lang = \(intLang)}")
                 let myRequest = URLRequest(url: u)
                 webView.load(myRequest)
             }
@@ -193,8 +192,8 @@ class FirstTabViewController: UIViewController, WKUIDelegate, UIScrollViewDelega
                     self.webView.evaluateJavaScript("reportContent('\(param1.split(separator: "|")[0])','\(param1.split(separator: "|")[1])',true);")
                 } else if param2 == "block_user" {
                     self.webView.evaluateJavaScript("blockUser('\(param1)',true);")
-                } else if param2 == "follow_store" {
-                    self.webView.evaluateJavaScript("follow(true);")
+                } else if param2 == "follow_user" {
+                    self.webView.evaluateJavaScript("followUser('\(param1.split(separator: "|")[0])',\(param1.split(separator: "|")[1]),true);")
                 } else if param2 == "homepage" {
                     self.webView.evaluateJavaScript("window.location.href = '\(param1)';")
                 } else {

+ 11 - 13
appbuilder-ios/AppBuilder/AppBuilder/ThirdTabViewController.swift

@@ -64,18 +64,23 @@ class ThirdTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
         let me = UserDefaults.standard.string(forKey: "me")
         
         var myURL : URL?
+        let lang = UserDefaults.standard.string(forKey: "i18n_language")
+        var intLang = 0
+        if lang == "id" {
+            intLang = 1
+        }
         switch(ViewController.tab3){
         case "0":
-            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab1-main-only?f_pin=\(me ?? "")"
+            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab1-main-only?f_pin=\(me ?? "")&lang=\(intLang)"
             myURL = URL(string: address)
         case "1":
-            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab3-main-only?f_pin=\(me ?? "")"
+            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab3-main-only?f_pin=\(me ?? "")&lang=\(intLang)"
             myURL = URL(string: address)
         case "2":
-            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab1-main?f_pin=\(me ?? "")"
+            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab1-main?f_pin=\(me ?? "")&lang=\(intLang)"
             myURL = URL(string: address)
         case "3":
-            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab3-commerce?f_pin=\(me ?? "")"
+            address = "\(PrefsUtil.getURLBase() ?? "https://qmera.io/")nexilis/pages/tab3-commerce?f_pin=\(me ?? "")&lang=\(intLang)"
             myURL = URL(string: address)
         default:
             if(!ViewController.tab3.isEmpty){
@@ -92,13 +97,6 @@ class ThirdTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
         print(address)
         if let u = myURL{
             if dateRefresh == nil || Int(Date().timeIntervalSince(dateRefresh!)) >= 60 || ThirdTabViewController.forceRefresh {
-                let lang = UserDefaults.standard.string(forKey: "i18n_language")
-                var intLang = 0
-                if lang == "id" {
-                    intLang = 1
-                }
-                print("idLang \(intLang)")
-                self.webView.evaluateJavaScript("{window.localStorage.lang = \(intLang)}")
                 let myRequest = URLRequest(url: u)
                 webView.load(myRequest)
             }
@@ -195,8 +193,8 @@ class ThirdTabViewController: UIViewController, UIScrollViewDelegate, UIGestureR
                     self.webView.evaluateJavaScript("reportContent('\(param1.split(separator: "|")[0])','\(param1.split(separator: "|")[1])',true);")
                 } else if param2 == "block_user" {
                     self.webView.evaluateJavaScript("blockUser('\(param1)',true);")
-                } else if param2 == "follow_store" {
-                    self.webView.evaluateJavaScript("follow(true);")
+                } else if param2 == "follow_user" {
+                    self.webView.evaluateJavaScript("followUser('\(param1.split(separator: "|")[0])',\(param1.split(separator: "|")[1]),true);")
                 } else if param2 == "homepage" {
                     self.webView.evaluateJavaScript("window.location.href = '\(param1)';")
                 } else {