You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
161
-
161
+
162
162
//
163
163
// THIS IS IMPORTANT!
164
164
//
165
165
// When adding any logic here mind the migration process
166
166
//
167
167
[self.balanceNotifier updateBalance];
168
+
169
+
// Check geo-restriction for PiggyCards (if available)
170
+
// This logs location info each time the app becomes active for debugging
171
+
SEL checkGeoRestrictionSelector = NSSelectorFromString(@"checkGeoRestriction");
172
+
if ([ExploreDashObjcWrapper respondsToSelector:checkGeoRestrictionSelector]) {
Copy file name to clipboardExpand all lines: DashWallet/Sources/Models/Explore Dash/Infrastructure/DAO Impl/MerchantDAO.swift
+54-14Lines changed: 54 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -134,8 +134,14 @@ class MerchantDAO: PointOfUseDAO {
134
134
// Using literal expression to handle cases where redeemType column might not exist
135
135
queryFilter = queryFilter && Expression<Bool>(literal:"(redeemType IS NULL OR redeemType != 'url')")
136
136
137
-
// Filter out PiggyCards-only merchants when PIGGYCARDS_ENABLED is not defined
138
-
#if !PIGGYCARDS_ENABLED
137
+
// Filter out PiggyCards-only merchants when:
138
+
// 1. PIGGYCARDS_ENABLED is not defined, OR
139
+
// 2. PIGGYCARDS_ENABLED is defined but user is in a restricted region (Russia or Cuba)
140
+
#if PIGGYCARDS_ENABLED
141
+
ifisPiggyCardsGeoRestricted(){
142
+
queryFilter = queryFilter && Expression<Bool>(literal:"merchantId NOT IN (SELECT DISTINCT merchantId FROM gift_card_providers WHERE provider = 'PiggyCards' AND merchantId NOT IN (SELECT DISTINCT merchantId FROM gift_card_providers WHERE provider != 'PiggyCards'))")
143
+
}
144
+
#else
139
145
queryFilter = queryFilter && Expression<Bool>(literal:"merchantId NOT IN (SELECT DISTINCT merchantId FROM gift_card_providers WHERE provider = 'PiggyCards' AND merchantId NOT IN (SELECT DISTINCT merchantId FROM gift_card_providers WHERE provider != 'PiggyCards'))")
140
146
#endif
141
147
@@ -202,12 +208,21 @@ class MerchantDAO: PointOfUseDAO {
202
208
// Fetch gift card providers for each merchant that accepts gift cards
0 commit comments