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
2024-10-31 12:36:57 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d8f3bffaf93a8f5854935b63ba22dc0ae816d315
d8f3bffa
1 parent
0b34d9a9
fix my rewards supermarket deals tile count
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
SwiftWarplyFramework/SwiftWarplyFramework/WalletViewController.swift
View file @
d8f3bff
...
...
@@ -69,6 +69,7 @@ import SwiftEventBus
public
var
loyaltyBadge
:
swiftApi
.
LoyaltyBadgeModel
=
swiftApi
()
.
getLoyaltyBadge
()
public
var
profile
:
swiftApi
.
ProfileModel
?
=
swiftApi
()
.
getConsumer
()
public
var
unifiedCoupons
:
Array
<
swiftApi
.
UnifiedCouponModel
>
=
[]
public
var
smCoupons
:
Array
<
swiftApi
.
CouponItemModel
>
=
[]
// swiftApi().getSMCouponList()
public
var
boxCoupons
:
Array
<
swiftApi
.
ActiveBoxCouponModel
>
=
swiftApi
()
.
getActiveBoxCoupons
()
var
timerWallet
:
DispatchSourceTimer
?
...
...
@@ -114,6 +115,15 @@ import SwiftEventBus
}
}
SwiftEventBus
.
onBackgroundThread
(
self
,
name
:
"sm_coupons_fetched"
)
{
result
in
DispatchQueue
.
main
.
async
{
self
.
smCoupons
=
swiftApi
()
.
getSMCouponList
()
self
.
handleSpinnerAndEmptyView
()
self
.
tableView
.
reloadData
()
}
}
SwiftEventBus
.
onBackgroundThread
(
self
,
name
:
"vouchers_fetched"
)
{
result
in
DispatchQueue
.
main
.
async
{
...
...
@@ -559,6 +569,7 @@ import SwiftEventBus
self
.
coupons
=
swiftApi
()
.
getCouponList
()
// TODO: Uncomment when UnifiedCoupons will be shown again
self
.
unifiedCoupons
=
swiftApi
()
.
getUnifiedCouponList
()
self
.
smCoupons
=
swiftApi
()
.
getSMCouponList
()
// TODO: Maybe add this
self
.
matchOldSMCoupons
()
// <===
...
...
@@ -756,7 +767,7 @@ import SwiftEventBus
self
.
showSpinner
=
true
if
(
self
.
dfyCoupons
.
count
==
0
&&
self
.
unifiedCoupons
.
count
==
0
&&
self
.
coupons
.
count
==
0
)
{
if
(
self
.
dfyCoupons
.
count
==
0
&&
self
.
unifiedCoupons
.
count
==
0
&&
self
.
smCoupons
.
count
==
0
&&
self
.
coupons
.
count
==
0
)
{
self
.
showActiveCouponsBanners
=
false
}
else
{
...
...
@@ -766,7 +777,7 @@ import SwiftEventBus
}
else
{
self
.
showSpinner
=
false
if
(
self
.
dfyCoupons
.
count
==
0
&&
self
.
unifiedCoupons
.
count
==
0
&&
self
.
coupons
.
count
==
0
)
{
if
(
self
.
dfyCoupons
.
count
==
0
&&
self
.
unifiedCoupons
.
count
==
0
&&
self
.
smCoupons
.
count
==
0
&&
self
.
coupons
.
count
==
0
)
{
self
.
showActiveCouponsBanners
=
false
if
(
swiftApi
()
.
getShowVouchersBanner
()
==
"null"
)
{
...
...
@@ -1393,7 +1404,8 @@ extension WalletViewController: UITableViewDelegate, UITableViewDataSource{
if
(
indexPath
.
section
==
0
)
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"WalletActiveCouponsScrollTableViewCellId"
,
for
:
indexPath
)
as!
WalletActiveCouponsScrollTableViewCell
// cell.configureCell(dfyCount: self.dfyCoupons.count, smCount: self.unifiedCoupons.count, gfyCount: self.coupons.count, boxCount: self.boxCoupons.count)
cell
.
configureCell
(
dfyCount
:
self
.
dfyCoupons
.
count
,
smCount
:
self
.
unifiedCoupons
.
count
,
gfyCount
:
self
.
coupons
.
count
,
boxCount
:
0
)
let
smCount
=
self
.
unifiedCoupons
.
count
+
self
.
smCoupons
.
count
cell
.
configureCell
(
dfyCount
:
self
.
dfyCoupons
.
count
,
smCount
:
smCount
,
gfyCount
:
self
.
coupons
.
count
,
boxCount
:
0
)
cell
.
parent
=
self
return
cell
...
...
Please
register
or
login
to post a comment