File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
WooCommerce/Classes/ViewModels/Order Details/Receipts Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,12 @@ final class ReceiptEligibilityUseCase: ReceiptEligibilityUseCaseProtocol {
2525 self . featureFlagService = featureFlagService
2626 }
2727
28- @MainActor
2928 func isEligibleForBackendReceipts( onCompletion: @escaping ( Bool ) -> Void ) {
30- let wcPlugin = pluginsService . loadPluginInStorage ( siteID : siteID , plugin : . wooCommerce , isActive : true )
31- // 1. WooCommerce must be installed and active
32- guard let wcPlugin , wcPlugin . active else {
33- return onCompletion ( false )
29+ Task { @ MainActor in
30+ let isWooCommerceSupported = await isPluginSupported ( . wooCommerce ,
31+ minimumVersion : Constants . BackendReceipt . wcPluginMinimumVersion )
32+ onCompletion ( isWooCommerceSupported )
3433 }
35- // 2. If WooCommerce version is higher than minimum required version, mark as eligible
36- let isSupported = VersionHelpers . isVersionSupported ( version: wcPlugin. version,
37- minimumRequired: Constants . BackendReceipt. wcPluginMinimumVersion)
38- onCompletion ( isSupported)
3934 }
4035
4136 /// Returns true if Point of Sale allows sending successful payment email receipts via the API.
You can’t perform that action at this time.
0 commit comments