Files
openclaw-openclaw/apps/ios/Sources/Gateway/GatewayProblemPrimaryAction.swift
Josh Avant 6438c89f05 fix(mobile): clarify gateway connection security setup (#101325)
* fix(mobile): clarify gateway connection setup

* chore(i18n): sync native mobile strings

* fix(mobile): align manual gateway previews

* chore(i18n): refresh native source inventory

* chore(android): remove unused connect tab strings

* test(i18n): drop removed connect tab sentinel

* fix(ios): brand connection security picker labels

* fix(mobile): hide gateway endpoint previews

* chore(i18n): sync native source inventory

* fix(mobile): remove redundant TLS helper copy
2026-07-07 14:43:11 -05:00

39 lines
1.1 KiB
Swift

import OpenClawKit
import UIKit
enum GatewayProblemPrimaryAction {
static func title(
for problem: GatewayConnectionProblem,
retryTitle: String,
resetTitle: String? = nil,
nonRetryableTitle: String? = nil) -> String?
{
if problem.suggestsOnboardingReset, let resetTitle {
return resetTitle
}
if problem.canTrustRotatedCertificate {
return "Trust certificate"
}
if problem.kind == .protocolMismatch {
return problem.actionLabel
}
if problem.retryable {
return problem.actionLabel ?? retryTitle
}
return nonRetryableTitle
}
@MainActor
static func handleProtocolMismatchIfNeeded(_ problem: GatewayConnectionProblem) -> Bool {
guard problem.kind == .protocolMismatch else { return false }
if let command = problem.actionCommand {
UIPasteboard.general.string = command
return true
}
if let url = problem.docsURL {
UIApplication.shared.open(url)
}
return true
}
}