fix(watch): parse encoded avatar URL

This commit is contained in:
Vincent Koc
2026-07-12 15:35:06 +02:00
parent f7739ad676
commit dfa9c96e17
2 changed files with 3 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ struct WatchChatStatusLocalizationTests {
#expect(snapshot.gatewayStatus.code == .gatewayProblem)
#expect(snapshot.gatewayStatus.localizationKey == "Gateway update required")
#expect(snapshot.gatewayStatus.verbatim == nil)
#expect(snapshot.agentAvatarURL == "https://example.com/avatar.png")
#expect(snapshot.talkStatus.code == .talkOff)
#expect(snapshot.chatStatus?.code == .chatConnectIPhone)
}
@@ -158,6 +159,7 @@ struct WatchChatStatusLocalizationTests {
],
"gatewayConnected": false,
"agentName": "Main",
"agentAvatarURL": "https://example.com/avatar.png",
"sessionKey": "main",
"talkStatus": [
"code": OpenClawWatchAppStatusCode.talkOff.rawValue,

View File

@@ -500,7 +500,7 @@ struct WatchAppSnapshotMessage: Codable, Equatable {
let gatewayConnected = Self.boolValue(payload["gatewayConnected"])
let agentName = (payload["agentName"] as? String)?
.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
let agentAvatarURL = (payload["agentAvatarUrl"] as? String)?
let agentAvatarURL = (payload["agentAvatarURL"] as? String)?
.trimmingCharacters(in: .whitespacesAndNewlines)
let agentAvatarText = (payload["agentAvatarText"] as? String)?
.trimmingCharacters(in: .whitespacesAndNewlines)