updated the likes and fav
This commit is contained in:
@@ -130,6 +130,12 @@ class MyListVM{
|
||||
self.vc.toast(msg: data.message ?? "Unrecognised error" , time: 2)
|
||||
MyListDataTemp.shareInstance.webSeriesHindi.removeAll()
|
||||
MyListDataTemp.shareInstance.favListingData = nil
|
||||
// make this true if mylist is loaded once
|
||||
MyListDataTemp.shareInstance.isDatafetched = true
|
||||
|
||||
if MyListDataTemp.shareInstance.favListingData?.showData == nil {
|
||||
MyListDataTemp.shareInstance.favListingData = FavouriteListingDM.ResultData(showData: [], videoData: [], gameData: [], singKaraokeData: [], audioData: [])
|
||||
}
|
||||
reloadCollections()
|
||||
checkNil()
|
||||
case 1:
|
||||
@@ -152,6 +158,7 @@ class MyListVM{
|
||||
}.map { element -> FavouriteListingDM.ResultData.ShowDatum in
|
||||
var modifiedElement = element
|
||||
modifiedElement.bookmarkCategoryIDS = "18"
|
||||
modifiedElement.categoryMasterID = "18"
|
||||
return modifiedElement
|
||||
}
|
||||
|
||||
@@ -182,7 +189,12 @@ class MyListVM{
|
||||
|
||||
|
||||
// Updating the showData with the filtered list
|
||||
MyListDataTemp.shareInstance.favListingData?.showData = hindiData
|
||||
// MyListDataTemp.shareInstance.favListingData?.showData = hindiData.map({$0.categoryMasterID = 1})
|
||||
MyListDataTemp.shareInstance.favListingData?.showData = hindiData.map { item in
|
||||
var modifiedItem = item
|
||||
modifiedItem.categoryMasterID = "1"
|
||||
return modifiedItem
|
||||
}
|
||||
|
||||
// make this true if mylist is loaded once
|
||||
MyListDataTemp.shareInstance.isDatafetched = true
|
||||
@@ -198,6 +210,9 @@ class MyListVM{
|
||||
self.refreshControl.endRefreshing()
|
||||
Utilities.dismissProgressHUD()
|
||||
checkNil()
|
||||
if MyListDataTemp.shareInstance.favListingData?.showData == nil {
|
||||
MyListDataTemp.shareInstance.favListingData = FavouriteListingDM.ResultData(showData: [], videoData: [], gameData: [], singKaraokeData: [], audioData: [])
|
||||
}
|
||||
self.vc.toast(msg: error.localizedDescription , time: 2)
|
||||
}
|
||||
}
|
||||
@@ -307,10 +322,16 @@ class MyListVM{
|
||||
}
|
||||
|
||||
func checkNil(){
|
||||
guard let data = MyListDataTemp.shareInstance.favListingData else{
|
||||
self.vc.noDataStack.isHidden = false
|
||||
|
||||
guard let data = MyListDataTemp.shareInstance.favListingData else{
|
||||
if MyListDataTemp.shareInstance.webSeriesHindi.count != 0 {
|
||||
self.vc.noDataStack.isHidden = true
|
||||
}else{
|
||||
self.vc.noDataStack.isHidden = false
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if data.showData?.count == 0 && data.singKaraokeData?.count == 0 && data.gameData?.count == 0 && data.audioData?.count == 0 && MyListDataTemp.shareInstance.webSeriesHindi.count == 0{
|
||||
self.vc.noDataStack.isHidden = false
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user