mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-09 01:10:34 +08:00
* 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
39 lines
1.1 KiB
Swift
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
|
|
}
|
|
}
|