Skip to content

Commit cba31c3

Browse files
bfoss765claude
andcommitted
fix: remove debug print statements from PointOfUseDetailsView
- Remove all debug print statements that were causing build noise - Restore proper file structure after correcting compilation errors - Clean up phone call action debug logging - Clean up location fetch and merchant data debug logging 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 14242e7 commit cba31c3

1 file changed

Lines changed: 0 additions & 66 deletions

File tree

DashWallet/Sources/UI/Explore Dash/Merchants & ATMs/Details/Views/PointOfUseDetailsView.swift

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -137,31 +137,24 @@ class PointOfUseDetailsView: UIView, SyncingActivityMonitorObserver, NetworkReac
137137

138138
@objc func callAction() {
139139
guard let phone = merchant.phone, !phone.isEmpty else { return }
140-
print("DEBUG: Original phone: \(phone)")
141140

142141
// Extract only digits for phone call
143142
let digits = phone.components(separatedBy: CharacterSet.decimalDigits.inverted).joined()
144143
guard !digits.isEmpty else { return }
145-
print("DEBUG: Extracted digits: \(digits)")
146144

147145
// Use telprompt: to directly open phone app (tel: shows options)
148146
let urlString = "telprompt:\(digits)"
149-
print("DEBUG: URL string: \(urlString)")
150147

151148
guard let url = URL(string: urlString) else {
152-
print("DEBUG: Failed to create URL")
153149
return
154150
}
155151

156152
// Check if device can open the URL
157153
guard UIApplication.shared.canOpenURL(url) else {
158-
print("DEBUG: Cannot open URL - phone not available")
159154
return
160155
}
161156

162-
print("DEBUG: Opening URL: \(url)")
163157
UIApplication.shared.open(url, options: [:], completionHandler: { success in
164-
print("DEBUG: URL open result: \(success)")
165158
})
166159
}
167160

@@ -563,33 +556,21 @@ extension PointOfUseDetailsView {
563556
}
564557

565558
private func getLocationCount() -> Int {
566-
print("DEBUG_FETCH_RESULTS: getLocationCount() called, returning: \(locationCount)")
567559
return locationCount
568560
}
569561

570562
private func fetchLocationCount() {
571563
// Debug logging for ALL merchants to help identify the issue
572-
print("DEBUG_FETCH_COUNT: Starting location fetch for merchant: '\(merchant.name)'")
573-
print("DEBUG_FETCH_COUNT: pointOfUseId: '\(merchant.pointOfUseId)'")
574564
if let merchantData = merchant.merchant {
575-
print("DEBUG_FETCH_COUNT: merchantId: '\(merchantData.merchantId)'")
576565
}
577-
print("DEBUG_FETCH_COUNT: merchant.active: \(merchant.active)")
578566

579567
// Debug the current filter radius being used
580568
let kMetersToMilesConversion: Double = 1609.34
581569
let filterRadius = currentFilters?.currentRadius ?? kDefaultRadius
582-
print("DEBUG_FETCH_COUNT: Using radius: \(filterRadius) meters (\(filterRadius / kMetersToMilesConversion) miles)")
583570
if let filterRadiusEnum = currentFilters?.radius {
584-
print("DEBUG_FETCH_COUNT: Filter radius setting: \(filterRadiusEnum.displayText)")
585571
}
586572

587573
// Debug location manager status
588-
print("DEBUG_FETCH_COUNT: Location manager status:")
589-
print("DEBUG_FETCH_COUNT: needsAuthorization: \(DWLocationManager.shared.needsAuthorization)")
590-
print("DEBUG_FETCH_COUNT: isAuthorized: \(DWLocationManager.shared.isAuthorized)")
591-
print("DEBUG_FETCH_COUNT: isPermissionDenied: \(DWLocationManager.shared.isPermissionDenied)")
592-
print("DEBUG_FETCH_COUNT: currentLocation available: \(DWLocationManager.shared.currentLocation != nil)")
593574

594575
// Fetch the actual location count from the data source
595576
// Use current map bounds if available (from map interaction), otherwise fall back to filter radius
@@ -599,16 +580,13 @@ extension PointOfUseDetailsView {
599580
if let mapBounds = currentMapBounds {
600581
// Use the current visible map bounds (when user has zoomed/panned the map)
601582
bounds = mapBounds
602-
print("DEBUG_FETCH_COUNT: Using current map bounds from user interaction")
603583
} else if let userLocation = userPoint {
604584
// Fall back to filter radius approach when no map bounds available
605585
let radiusInMeters: Double = filterRadius
606586
let circle = MKCircle(center: userLocation, radius: radiusInMeters)
607587
bounds = ExploreMapBounds(rect: circle.boundingMapRect)
608-
print("DEBUG_FETCH_COUNT: Using filter radius: \(filterRadius) meters")
609588
} else {
610589
bounds = nil
611-
print("DEBUG_FETCH_COUNT: No bounds or user location available")
612590
}
613591

614592
// Use the exact same logic as AllMerchantLocationsDataProvider
@@ -618,24 +596,17 @@ extension PointOfUseDetailsView {
618596

619597
if DWLocationManager.shared.isPermissionDenied || DWLocationManager.shared.needsAuthorization {
620598
// When location is denied/not authorized, fetch all locations globally (no bounds filter)
621-
print("DEBUG_FETCH_RESULTS: Location denied/not authorized, fetching all locations globally")
622599
finalBounds = nil
623600
finalUserPoint = nil
624601
} else if DWLocationManager.shared.isAuthorized && (bounds == nil || userPoint == nil) {
625602
// Location is authorized but current location not available yet, fetch all globally
626-
print("DEBUG_FETCH_RESULTS: Location authorized but not available yet, fetching all locations globally")
627603
finalBounds = nil
628604
finalUserPoint = nil
629605
}
630606

631607
// Debug final parameters being used
632-
print("DEBUG_FETCH_COUNT: Final API call parameters:")
633-
print("DEBUG_FETCH_COUNT: pointOfUseId: '\(merchant.pointOfUseId)'")
634-
print("DEBUG_FETCH_COUNT: finalBounds: \(finalBounds != nil ? "set" : "nil")")
635608
if let userPoint = finalUserPoint {
636-
print("DEBUG_FETCH_COUNT: finalUserPoint: (\(userPoint.latitude), \(userPoint.longitude))")
637609
} else {
638-
print("DEBUG_FETCH_COUNT: finalUserPoint: nil")
639610
}
640611

641612
// Use the same call as AllMerchantLocationsDataProvider
@@ -649,24 +620,16 @@ extension PointOfUseDetailsView {
649620

650621
// Debug logging
651622
if let strongSelf = self {
652-
print("DEBUG_FETCH_RESULTS: Results for '\(strongSelf.merchant.name)'")
653-
print("DEBUG_FETCH_RESULTS: Total GameStop locations: \(paginationResult.items.count)")
654-
print("DEBUG_FETCH_RESULTS: Active GameStop locations: \(activeLocations.count)")
655623
let inactiveLocations = paginationResult.items.filter { !$0.active }
656-
print("DEBUG_FETCH_RESULTS: Inactive GameStop locations: \(inactiveLocations.count)")
657624
}
658625

659626
// Use the count of active locations (this should match what "Show all locations" shows)
660627
let newCount = activeLocations.count
661-
print("DEBUG_FETCH_RESULTS: Setting locationCount to \(newCount)")
662628
self?.locationCount = newCount
663-
print("DEBUG_FETCH_RESULTS: locationCount after assignment: \(self?.locationCount ?? -1)")
664629
self?.updateShowAllLocationsButton()
665-
print("DEBUG_FETCH_RESULTS: locationCount after updateShowAllLocationsButton: \(self?.locationCount ?? -1)")
666630
}
667631
case .failure(let error):
668632
// Log error but keep default count of 1
669-
print("DEBUG_FETCH_RESULTS: API call failed with error: \(error)")
670633
DSLogger.log("Failed to fetch location count: \(error)")
671634
DispatchQueue.main.async {
672635
// Set count to 1 as fallback when API fails
@@ -680,33 +643,26 @@ extension PointOfUseDetailsView {
680643
private func updateShowAllLocationsButton() {
681644
// Find and update the "Show all locations" button text
682645
// This is called after the location count is fetched
683-
print("DEBUG_FETCH_RESULTS: updateShowAllLocationsButton called with locationCount: \(locationCount)")
684646
guard !isShowAllHidden, let containerView = containerView else {
685-
print("DEBUG_FETCH_RESULTS: Guard failed - isShowAllHidden: \(isShowAllHidden), containerView exists: \(containerView != nil)")
686647
return
687648
}
688649

689-
print("DEBUG_FETCH_RESULTS: Container has \(containerView.arrangedSubviews.count) arranged subviews")
690650

691651
// Find the show all locations block (should be the last arranged subview)
692652
if let showAllBlock = containerView.arrangedSubviews.last {
693-
print("DEBUG_FETCH_RESULTS: Found show all block with \(showAllBlock.subviews.count) subviews")
694653

695654
// Find the button within the block
696655
for (index, subview) in showAllBlock.subviews.enumerated() {
697-
print("DEBUG_FETCH_RESULTS: Checking subview \(index): \(type(of: subview))")
698656
if let button = subview as? UIButton {
699657
let newTitle = String.localizedStringWithFormat(
700658
NSLocalizedString("Show all locations (%d)", comment: "Show all locations with count"),
701659
locationCount
702660
)
703-
print("DEBUG_FETCH_RESULTS: Updating button title to: \(newTitle)")
704661
button.setTitle(newTitle, for: .normal)
705662
break
706663
}
707664
}
708665
} else {
709-
print("DEBUG_FETCH_RESULTS: No show all block found in container")
710666
}
711667
}
712668

@@ -1147,19 +1103,6 @@ extension PointOfUseDetailsView {
11471103

11481104
// Comprehensive debug logging for merchant fields investigation
11491105
if self.merchant.name.lowercased().contains("gamestop") || self.merchant.name.lowercased().contains("spotify") || self.merchant.name.lowercased().contains("buffalo") {
1150-
print("🎯 MERCHANT DEBUG: \(self.merchant.name)")
1151-
print(" merchantId: '\(merchant.merchantId)'")
1152-
print(" paymentMethod: '\(merchant.paymentMethod)'")
1153-
print(" type: '\(merchant.type)'")
1154-
print(" deeplink: '\(merchant.deeplink ?? "nil")'")
1155-
print(" savingsBasisPoints: '\(merchant.savingsBasisPoints)'")
1156-
print(" denominationsType: '\(merchant.denominationsType ?? "nil")'")
1157-
print(" denominations: '\(merchant.denominations)'")
1158-
print(" redeemType: '\(merchant.redeemType ?? "nil")'")
1159-
print(" enabled: '\(merchant.enabled?.description ?? "nil")'")
1160-
print(" self.merchant.active: '\(self.merchant.active)'")
1161-
print(" isEnabled: '\(isEnabled)'")
1162-
print(" ----------")
11631106
}
11641107

11651108
// Use denominationsType field to determine if amounts are fixed or flexible
@@ -1168,25 +1111,19 @@ extension PointOfUseDetailsView {
11681111

11691112
// Debug denominationsType for GameStop specifically
11701113
if self.merchant.name.lowercased().contains("gamestop") {
1171-
print("🎯 GAMESTOP DENOMINATIONS TYPE DEBUG:")
1172-
print(" Original denominationsType: '\(denominationsType)'")
1173-
print(" Lowercased denominationsType: '\(lowercasedType)'")
11741114
}
11751115

11761116
switch lowercasedType {
11771117
case "fixed":
11781118
if self.merchant.name.lowercased().contains("gamestop") {
1179-
print(" → Matched 'fixed' case - returning Fixed amounts")
11801119
}
11811120
return NSLocalizedString("Fixed amounts", comment: "DashSpend")
11821121
case "flexible", "min-max":
11831122
if self.merchant.name.lowercased().contains("gamestop") {
1184-
print(" → Matched 'flexible'/'min-max' case - returning Flexible amounts")
11851123
}
11861124
return NSLocalizedString("Flexible amounts", comment: "DashSpend")
11871125
default:
11881126
if self.merchant.name.lowercased().contains("gamestop") {
1189-
print(" → Matched 'default' case - returning Fixed amounts")
11901127
}
11911128
return NSLocalizedString("Fixed amounts", comment: "DashSpend")
11921129
}
@@ -1237,15 +1174,12 @@ extension PointOfUseDetailsView {
12371174

12381175
func setupGrabberPanGesture(target: Any, action: Selector) {
12391176
guard let grabberContainer = grabberContainer else {
1240-
print("DEBUG: grabberContainer is nil!")
12411177
return
12421178
}
1243-
print("DEBUG: Setting up pan gesture on grabber container")
12441179
let panRecognizer = UIPanGestureRecognizer(target: target, action: action)
12451180
panRecognizer.minimumNumberOfTouches = 1
12461181
panRecognizer.maximumNumberOfTouches = 1
12471182
grabberContainer.addGestureRecognizer(panRecognizer)
1248-
print("DEBUG: Pan gesture added to grabber container")
12491183
}
12501184

12511185
}

0 commit comments

Comments
 (0)