Showing
1 changed file
with
15 additions
and
2 deletions
... | @@ -19,6 +19,7 @@ public struct GlobalVariables { | ... | @@ -19,6 +19,7 @@ public struct GlobalVariables { |
19 | static var couponSetList: Array<swiftApi.CouponSetItemModel> = [] | 19 | static var couponSetList: Array<swiftApi.CouponSetItemModel> = [] |
20 | static var loyaltyBadge: swiftApi.LoyaltyBadgeModel = swiftApi.LoyaltyBadgeModel() | 20 | static var loyaltyBadge: swiftApi.LoyaltyBadgeModel = swiftApi.LoyaltyBadgeModel() |
21 | static var consumer: swiftApi.ProfileModel? | 21 | static var consumer: swiftApi.ProfileModel? |
22 | + static var consumerInternal: swiftApi.ProfileModel? | ||
22 | static var ccmsCampaigns: Array<swiftApi.LoyaltyContextualOfferModel> = [] | 23 | static var ccmsCampaigns: Array<swiftApi.LoyaltyContextualOfferModel> = [] |
23 | static var dealsSum: Float = 0.0 | 24 | static var dealsSum: Float = 0.0 |
24 | static var seasonalList: Array<swiftApi.LoyaltyGiftsForYouPackage> = [] | 25 | static var seasonalList: Array<swiftApi.LoyaltyGiftsForYouPackage> = [] |
... | @@ -1135,7 +1136,7 @@ public class swiftApi { | ... | @@ -1135,7 +1136,7 @@ public class swiftApi { |
1135 | return (!(isCcmsOffer || isTelco)) | 1136 | return (!(isCcmsOffer || isTelco)) |
1136 | } | 1137 | } |
1137 | 1138 | ||
1138 | - if (swiftApi().getConsumer()?._answered == true) { | 1139 | + if (swiftApi().getConsumerInternal()?._answered == true) { |
1139 | filteredCampaigns = filteredCampaigns.filter { $0.offer_category != "questionnaire" } | 1140 | filteredCampaigns = filteredCampaigns.filter { $0.offer_category != "questionnaire" } |
1140 | } | 1141 | } |
1141 | 1142 | ||
... | @@ -2201,6 +2202,7 @@ public class swiftApi { | ... | @@ -2201,6 +2202,7 @@ public class swiftApi { |
2201 | let tempProfile = ProfileModel(dictionary: profileDataResult) | 2202 | let tempProfile = ProfileModel(dictionary: profileDataResult) |
2202 | 2203 | ||
2203 | swiftApi().setConsumer(tempProfile ?? swiftApi.ProfileModel()) | 2204 | swiftApi().setConsumer(tempProfile ?? swiftApi.ProfileModel()) |
2205 | + swiftApi().setConsumerInternal(tempProfile ?? swiftApi.ProfileModel()) | ||
2204 | swiftApi().setUserTag(tempProfile._badge ?? "") | 2206 | swiftApi().setUserTag(tempProfile._badge ?? "") |
2205 | 2207 | ||
2206 | swiftApi().setUserNonTelco(tempProfile._nonTelco ?? false) | 2208 | swiftApi().setUserNonTelco(tempProfile._nonTelco ?? false) |
... | @@ -2288,6 +2290,7 @@ public class swiftApi { | ... | @@ -2288,6 +2290,7 @@ public class swiftApi { |
2288 | if (profileData != nil) { | 2290 | if (profileData != nil) { |
2289 | DispatchQueue.main.async { | 2291 | DispatchQueue.main.async { |
2290 | swiftApi().setConsumer(profileData ?? swiftApi.ProfileModel()) | 2292 | swiftApi().setConsumer(profileData ?? swiftApi.ProfileModel()) |
2293 | + swiftApi().setConsumerInternal(profileData ?? swiftApi.ProfileModel()) | ||
2291 | swiftApi().setUserTag(profileData?._badge ?? "") | 2294 | swiftApi().setUserTag(profileData?._badge ?? "") |
2292 | } | 2295 | } |
2293 | } else { | 2296 | } else { |
... | @@ -3761,7 +3764,7 @@ public class swiftApi { | ... | @@ -3761,7 +3764,7 @@ public class swiftApi { |
3761 | return (!(isCcmsOffer || isTelco)) | 3764 | return (!(isCcmsOffer || isTelco)) |
3762 | } | 3765 | } |
3763 | 3766 | ||
3764 | - if (swiftApi().getConsumer()?._answered == true) { | 3767 | + if (swiftApi().getConsumerInternal()?._answered == true) { |
3765 | filteredCampaigns = filteredCampaigns.filter { $0.offer_category != "questionnaire" } | 3768 | filteredCampaigns = filteredCampaigns.filter { $0.offer_category != "questionnaire" } |
3766 | } | 3769 | } |
3767 | 3770 | ||
... | @@ -3974,6 +3977,16 @@ public class swiftApi { | ... | @@ -3974,6 +3977,16 @@ public class swiftApi { |
3974 | return GlobalVariables.consumer | 3977 | return GlobalVariables.consumer |
3975 | } | 3978 | } |
3976 | 3979 | ||
3980 | + | ||
3981 | + public func setConsumerInternal(_ profile: ProfileModel) { | ||
3982 | + GlobalVariables.consumerInternal = profile | ||
3983 | + } | ||
3984 | + | ||
3985 | + | ||
3986 | + public func getConsumerInternal() -> ProfileModel? { | ||
3987 | + return GlobalVariables.consumerInternal | ||
3988 | + } | ||
3989 | + | ||
3977 | 3990 | ||
3978 | public func setDealsCouponsSum(_ sum: Float) { | 3991 | public func setDealsCouponsSum(_ sum: Float) { |
3979 | GlobalVariables.dealsSum = sum | 3992 | GlobalVariables.dealsSum = sum | ... | ... |
-
Please register or login to post a comment