|
@@ -221,17 +221,7 @@ class HomeVC: UIViewController {
|
|
|
clearMoreMenuNotifData()
|
|
clearMoreMenuNotifData()
|
|
|
|
|
|
|
|
if ConnectionHelper.isConnectedToNetwork() {
|
|
if ConnectionHelper.isConnectedToNetwork() {
|
|
|
- ConnectionHelper.checkIpAddress { [weak self] success in
|
|
|
|
|
- guard let self = self else { return }
|
|
|
|
|
-
|
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
|
- if success {
|
|
|
|
|
- self.presenter.loadMenuNotifications()
|
|
|
|
|
- } else {
|
|
|
|
|
- CommonHelper.showNotAllowConnection(in: self)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ self.presenter.loadMenuNotifications()
|
|
|
} else {
|
|
} else {
|
|
|
CommonHelper.showNoConnection(in: self)
|
|
CommonHelper.showNoConnection(in: self)
|
|
|
}
|
|
}
|
|
@@ -277,17 +267,7 @@ class HomeVC: UIViewController {
|
|
|
notifContainer.show()
|
|
notifContainer.show()
|
|
|
|
|
|
|
|
if ConnectionHelper.isConnectedToNetwork() {
|
|
if ConnectionHelper.isConnectedToNetwork() {
|
|
|
- ConnectionHelper.checkIpAddress { [weak self] success in
|
|
|
|
|
- guard let self = self else { return }
|
|
|
|
|
-
|
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
|
- if success {
|
|
|
|
|
- self.presenter.loadTotalUnreadNotif()
|
|
|
|
|
- } else {
|
|
|
|
|
- CommonHelper.showNotAllowConnection(in: self)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ self.presenter.loadTotalUnreadNotif()
|
|
|
} else {
|
|
} else {
|
|
|
CommonHelper.showNoConnection(in: self)
|
|
CommonHelper.showNoConnection(in: self)
|
|
|
}
|
|
}
|
|
@@ -319,20 +299,7 @@ class HomeVC: UIViewController {
|
|
|
homeNewsTV.tableFooterView = footer
|
|
homeNewsTV.tableFooterView = footer
|
|
|
|
|
|
|
|
if ConnectionHelper.isConnectedToNetwork() {
|
|
if ConnectionHelper.isConnectedToNetwork() {
|
|
|
- ConnectionHelper.checkIpAddress { [weak self] success in
|
|
|
|
|
- guard let self = self else { return }
|
|
|
|
|
-
|
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
|
- if success {
|
|
|
|
|
- print("call news")
|
|
|
|
|
- self.presenter.loadNews(cursor: 5, prev: 1, jenis: "", columns: "")
|
|
|
|
|
- } else {
|
|
|
|
|
- CommonHelper.showNotAllowConnection(in: self)
|
|
|
|
|
- self.listNews.removeAll()
|
|
|
|
|
- self.homeNewsTV.reloadData()
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ self.presenter.loadNews(cursor: 5, prev: 1, jenis: "", columns: "")
|
|
|
} else {
|
|
} else {
|
|
|
CommonHelper.showNoConnection(in: self)
|
|
CommonHelper.showNoConnection(in: self)
|
|
|
}
|
|
}
|
|
@@ -340,20 +307,7 @@ class HomeVC: UIViewController {
|
|
|
|
|
|
|
|
private func setSlideImageView() {
|
|
private func setSlideImageView() {
|
|
|
if ConnectionHelper.isConnectedToNetwork() {
|
|
if ConnectionHelper.isConnectedToNetwork() {
|
|
|
- ConnectionHelper.checkIpAddress { [weak self] success in
|
|
|
|
|
- guard let self = self else { return }
|
|
|
|
|
-
|
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
|
- if success {
|
|
|
|
|
- print("call slideimage")
|
|
|
|
|
- self.presenter.loadSlideshowImages()
|
|
|
|
|
- } else {
|
|
|
|
|
- CommonHelper.showNotAllowConnection(in: self)
|
|
|
|
|
- self.slideshow.setImageInputs([])
|
|
|
|
|
- self.slideshow.reloadInputViews()
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ self.presenter.loadSlideshowImages()
|
|
|
} else {
|
|
} else {
|
|
|
CommonHelper.showNoConnection(in: self)
|
|
CommonHelper.showNoConnection(in: self)
|
|
|
}
|
|
}
|
|
@@ -696,17 +650,7 @@ class HomeVC: UIViewController {
|
|
|
clearMoreMenuNotifData()
|
|
clearMoreMenuNotifData()
|
|
|
|
|
|
|
|
if ConnectionHelper.isConnectedToNetwork() {
|
|
if ConnectionHelper.isConnectedToNetwork() {
|
|
|
- ConnectionHelper.checkIpAddress { [weak self] success in
|
|
|
|
|
- guard let self = self else { return }
|
|
|
|
|
-
|
|
|
|
|
- DispatchQueue.main.async {
|
|
|
|
|
- if success {
|
|
|
|
|
- self.presenter.loadMenuNotifications()
|
|
|
|
|
- } else {
|
|
|
|
|
- CommonHelper.showNotAllowConnection(in: self)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ self.presenter.loadMenuNotifications()
|
|
|
} else {
|
|
} else {
|
|
|
CommonHelper.showNoConnection(in: self)
|
|
CommonHelper.showNoConnection(in: self)
|
|
|
}
|
|
}
|