Skip to content

Commit 8afa16e

Browse files
committed
The closure does not need to be optional
1 parent 2875fda commit 8afa16e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

WooCommerce/Classes/ViewModels/Order Details/OrderDetailsViewModel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,12 @@ extension OrderDetailsViewModel {
607607
stores.dispatch(action)
608608
}
609609

610-
func checkCardPresentPaymentEligibility(onCompletion: (() -> Void)? = nil) {
610+
func checkCardPresentPaymentEligibility(onCompletion: @escaping (() -> Void)) {
611611
let configuration = configurationLoader.configuration
612612

613613
guard configuration.isSupportedCountry else {
614614
dataSource.isEligibleForCardPresentPayment = false
615-
onCompletion?()
615+
onCompletion()
616616
return
617617
}
618618

@@ -627,7 +627,7 @@ extension OrderDetailsViewModel {
627627
self?.dataSource.isEligibleForCardPresentPayment = false
628628
}
629629

630-
onCompletion?()
630+
onCompletion()
631631
}
632632

633633
stores.dispatch(action)

0 commit comments

Comments
 (0)