Skip to content

Commit 83944b5

Browse files
committed
Remove unnecessary "Observation+WithObservationTrackingOf" file
1 parent a31e679 commit 83944b5

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

Modules/Sources/PointOfSale/Extensions/Observation+WithObservationTrackingOf.swift

Lines changed: 0 additions & 14 deletions
This file was deleted.

Modules/Sources/PointOfSale/Models/PointOfSaleAggregateModel.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,11 +604,15 @@ extension PointOfSaleAggregateModel {
604604
// MARK: - Incremental catalog sync on payment success
605605

606606
private extension PointOfSaleAggregateModel {
607-
private func setupPaymentSuccessObservation() {
608-
withObservationTracking(of: self.paymentState.isSuccess) { [weak self] success in
609-
if success {
610-
self?.performIncrementalSync()
607+
@Sendable private func setupPaymentSuccessObservation() {
608+
withObservationTracking { [weak self] in
609+
guard let self else { return }
610+
if paymentState.isSuccess {
611+
performIncrementalSync()
611612
}
613+
} onChange: { [weak self] in
614+
guard let self else { return }
615+
DispatchQueue.main.async(execute: setupPaymentSuccessObservation)
612616
}
613617
}
614618

0 commit comments

Comments
 (0)