|
@@ -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 {
|