Skip to content

Commit c488400

Browse files
committed
Add clarifying comments
1 parent 55c09ed commit c488400

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Settings/In-Person Payments/InPersonPaymentsMenuViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ private extension InPersonPaymentsMenuViewController {
126126
return
127127
}
128128

129+
// Instead of using `CardPresentPaymentsOnboardingPresenter` we create the view directly because we already have the onboarding state in the use case.
130+
// That way we avoid triggering the onboarding check again that comes with the presenter.
129131
let onboardingViewModel = InPersonPaymentsViewModel(useCase: cardPresentPaymentsOnboardingUseCase, showMenuOnCompletion: false)
130132
onboardingViewModel.onOnboardingCompletion = { [weak self] plugin in
131133
self?.refreshAfterNewOnboardingState(.completed(plugin: plugin))

WooCommerce/Classes/ViewRelated/Orders/Collect Payments/CardPresentPaymentsOnboardingPresenter.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ protocol CardPresentPaymentsOnboardingPresenting {
99
func refresh()
1010
}
1111

12+
/// Checks for the current user status regarding Card Present Payments,
13+
/// and shows the onboarding if the user didn't finish the onboarding to use CPP
14+
///
1215
final class CardPresentPaymentsOnboardingPresenter: CardPresentPaymentsOnboardingPresenting {
1316

1417
private let stores: StoresManager

0 commit comments

Comments
 (0)