Skip to content

Commit

Permalink
Don’t repeatedly try to hide onboarding
Browse files Browse the repository at this point in the history
When onboarding has been completed, we hide onboarding and call a completion handler to indicate to the payment systems that we’re ready to collect a payment.

This is done in a Combine subscription handler, but that was not cleared after we called completion.

This adds risk that we might try to hide onboarding twice (which would be fine) and then start the payment twice (which wouldn’t be great!)

This commit clears the subscription when we’ve completed onboarding.
  • Loading branch information
joshheald committed Sep 23, 2024
1 parent 37c2564 commit 082ee1f
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ final class CardPresentPaymentsOnboardingPresenter: CardPresentPaymentsOnboardin
self?.hideOnboarding(onboardingViewController)

completion()

self?.readinessSubscription = nil
})
}

Expand Down

0 comments on commit 082ee1f

Please sign in to comment.