Skip to content

Commit 5878dbb

Browse files
committed
POSIneligibleView: hide the retry CTA for unsupported iOS version case as there is no way to retry in the app.
1 parent 53e3bca commit 5878dbb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

WooCommerce/Classes/POS/TabBar/POSIneligibleView.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct POSIneligibleView: View {
5757
Text(Localization.refreshEligibility)
5858
}
5959
.buttonStyle(POSFilledButtonStyle(size: .normal, isLoading: isLoading))
60+
.renderedIf(reason.shouldShowRetryButton)
6061

6162
Button {
6263
dismiss()
@@ -143,6 +144,23 @@ private extension POSIneligibleView {
143144
}
144145
}
145146

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

148166
#Preview("Unsupported currency") {

0 commit comments

Comments
 (0)