Skip to content

Commit afd4650

Browse files
authored
[POS as a tab i2] Hide retry CTA for unsupported iOS version in POS ineligible view (#15914)
2 parents 2329236 + dabd07e commit afd4650

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

WooCommerce/Classes/POS/TabBar/POSIneligibleView.swift

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ struct POSIneligibleView: View {
1414
Spacer()
1515

1616
VStack(alignment: .center, spacing: POSSpacing.none) {
17-
Image(PointOfSaleAssets.exclamationMark.imageName)
18-
.resizable()
19-
.frame(width: POSErrorAndAlertIconSize.large.dimension,
20-
height: POSErrorAndAlertIconSize.large.dimension)
17+
POSErrorXMark()
2118

2219
Spacer()
2320
.frame(height: POSSpacing.medium)
@@ -57,6 +54,7 @@ struct POSIneligibleView: View {
5754
Text(Localization.refreshEligibility)
5855
}
5956
.buttonStyle(POSFilledButtonStyle(size: .normal, isLoading: isLoading))
57+
.renderedIf(reason.shouldShowRetryButton)
6058

6159
Button {
6260
dismiss()
@@ -143,6 +141,23 @@ private extension POSIneligibleView {
143141
}
144142
}
145143

144+
@available(iOS 17.0, *)
145+
private extension POSIneligibleReason {
146+
var shouldShowRetryButton: Bool {
147+
switch self {
148+
case .unsupportedIOSVersion:
149+
return false
150+
case .unsupportedWooCommerceVersion,
151+
.siteSettingsNotAvailable,
152+
.wooCommercePluginNotFound,
153+
.featureSwitchDisabled,
154+
.unsupportedCurrency,
155+
.selfDeallocated:
156+
return true
157+
}
158+
}
159+
}
160+
146161
#if DEBUG
147162

148163
#Preview("Unsupported currency") {

0 commit comments

Comments
 (0)