Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-07-25 11:31:39 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9b41e18d4b5d3826ac6145ce3d81455d213d054d
9b41e18d
1 parent
d8a922c2
fix refreshing seasonals async
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
SwiftWarplyFramework/SwiftWarplyFramework/GiftsViewController.swift
View file @
9b41e18
...
...
@@ -41,12 +41,53 @@ import SwiftEventBus
SwiftEventBus
.
onMainThread
(
self
,
name
:
"ccms_retrieved"
)
{
result
in
print
(
"===== SwiftEventBus ccms_retrieved ====="
)
self
.
campaigns
=
swiftApi
()
.
mergeGFYCCMSLoyaltyCampaigns
(
campaigns
:
swiftApi
()
.
getCCMSLoyaltyCampaigns
())
self
.
seasonalList
=
swiftApi
()
.
getSeasonalList
()
if
(
seasonalList
.
count
>
0
)
{
for
seasonalItem
in
self
.
seasonalList
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
seasonalItem
.
_title
newCampaign
.
_logo_url
=
seasonalItem
.
_imageUrl
newCampaign
.
_loyaltyPackageId
=
seasonalItem
.
_loyaltyPackageId
self
.
campaigns
.
append
(
newCampaign
)
}
}
self
.
tableView
.
reloadData
()
}
SwiftEventBus
.
onMainThread
(
self
,
name
:
"campaigns_retrieved"
)
{
result
in
print
(
"===== SwiftEventBus campaigns_retrieved ====="
)
self
.
campaigns
=
swiftApi
()
.
mergeGFYCCMSLoyaltyCampaigns
(
campaigns
:
swiftApi
()
.
getCCMSLoyaltyCampaigns
())
self
.
seasonalList
=
swiftApi
()
.
getSeasonalList
()
if
(
seasonalList
.
count
>
0
)
{
for
seasonalItem
in
self
.
seasonalList
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
seasonalItem
.
_title
newCampaign
.
_logo_url
=
seasonalItem
.
_imageUrl
newCampaign
.
_loyaltyPackageId
=
seasonalItem
.
_loyaltyPackageId
self
.
campaigns
.
append
(
newCampaign
)
}
}
self
.
tableView
.
reloadData
()
}
SwiftEventBus
.
onMainThread
(
self
,
name
:
"seasonals_retrieved"
)
{
result
in
print
(
"===== SwiftEventBus seasonals_retrieved ====="
)
self
.
seasonalList
=
swiftApi
()
.
getSeasonalList
()
if
(
seasonalList
.
count
>
0
)
{
for
seasonalItem
in
self
.
seasonalList
{
let
newCampaign
=
swiftApi
.
CampaignItemModel
()
newCampaign
.
_title
=
seasonalItem
.
_title
newCampaign
.
_logo_url
=
seasonalItem
.
_imageUrl
newCampaign
.
_loyaltyPackageId
=
seasonalItem
.
_loyaltyPackageId
self
.
campaigns
.
append
(
newCampaign
)
}
}
self
.
tableView
.
reloadData
()
}
...
...
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
9b41e18
...
...
@@ -2977,6 +2977,8 @@ public class swiftApi {
public
func
setSeasonalList
(
_
seasonalCoupons
:
Array
<
LoyaltyGiftsForYouPackage
>
)
{
GlobalVariables
.
seasonalList
=
seasonalCoupons
SwiftEventBus
.
post
(
"seasonals_retrieved"
)
}
...
...
Please
register
or
login
to post a comment