mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-15 15:36:04 +00:00
* fix(ios): defer QR pairing after scanner dismissal * fix(ios): process QR pairing after scanner dismissal * fix(ios): harden QR scanner handoff * fix(ios): give QR scanner dismissal more time * fix(ios): keep onboarding open for QR trust prompt * fix(ios): keep QR trust prompt owned by onboarding * fix(ios): recover operator pairing after QR bootstrap * fix(ios): cancel stale QR scanner handoffs Co-authored-by: PollyBot13 <pollybot13@gmail.com> * fix(ios): defer QR setup until onboarding closes * fix(ios): keep QR setup links with visible settings * fix(ios): consume setup links during onboarding * fix(ios): handle setup links during onboarding launch * fix(ios): route setup links through active onboarding * fix(ios): harden QR gateway handoff * fix(ios): cancel superseded gateway attempts * fix(ios): serialize scanner result delivery * fix(ios): prevent stale gateway reconnects * fix(ios): serialize gateway target handoff * fix(ios): disable stale gateway relaunch route * fix(ios): await staged bootstrap reset * test(ios): bound gateway reset handoff * fix(ios): preserve explicit gateway handoff * fix(ios): harden gateway lifecycle ownership * chore(ios): sync native i18n inventory * test(ios): align gateway ownership assertions * refactor(ios): remove superseded gateway helpers * fix(ios): keep gateway auth route scoped * fix(ios): restore gateway target review state * fix(protocol): refresh Swift plugin approval model * test(ios): isolate state directory overrides * fix(ios): preserve watch alerts across gateway switches * fix(ios): bind deferred work to gateway ownership * docs(changelog): credit iOS gateway handoff fix * chore(i18n): sync native app inventory * test(ios): remove unused Watch approval hooks --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
47 lines
1.8 KiB
Swift
47 lines
1.8 KiB
Swift
import SwiftUI
|
|
|
|
struct GatewayTrustPromptAlert: ViewModifier {
|
|
@Environment(GatewayConnectionController.self) private var gatewayController: GatewayConnectionController
|
|
let isEnabled: Bool
|
|
|
|
func body(content: Content) -> some View {
|
|
content.alert(
|
|
"Trust this gateway?",
|
|
isPresented: Binding(
|
|
get: { self.isEnabled && self.gatewayController.pendingTrustPrompt != nil },
|
|
set: { _ in
|
|
// Keep pending trust state until explicit user action.
|
|
// SwiftUI may set presentation bindings during dismissal; clearing here can
|
|
// race with the trust button and make accept no-op.
|
|
}),
|
|
presenting: self.gatewayController.pendingTrustPrompt)
|
|
{ _ in
|
|
Button(role: .cancel) {
|
|
self.gatewayController.declinePendingTrustPrompt()
|
|
} label: {
|
|
Text("Cancel")
|
|
.font(OpenClawType.subheadSemiBold)
|
|
}
|
|
Button {
|
|
Task { await self.gatewayController.acceptPendingTrustPrompt() }
|
|
} label: {
|
|
Text("Trust and connect")
|
|
.font(OpenClawType.subheadSemiBold)
|
|
}
|
|
} message: { prompt in
|
|
Text(String(
|
|
format: NSLocalizedString(
|
|
"First-time TLS connection.\n\nVerify this SHA-256 fingerprint out-of-band before trusting:\n%@",
|
|
comment: "Gateway certificate trust instructions"),
|
|
prompt.fingerprintSha256))
|
|
.font(OpenClawType.subhead)
|
|
}
|
|
}
|
|
}
|
|
|
|
extension View {
|
|
func gatewayTrustPromptAlert(isEnabled: Bool = true) -> some View {
|
|
self.modifier(GatewayTrustPromptAlert(isEnabled: isEnabled))
|
|
}
|
|
}
|