fix(chat-ui): reflect gateway connection
parent
4cbaee59cd
commit
f3db02018f
|
|
@ -22,7 +22,7 @@ public final class ClawdisChatViewModel {
|
||||||
public private(set) var isSending = false
|
public private(set) var isSending = false
|
||||||
public var errorText: String?
|
public var errorText: String?
|
||||||
public var attachments: [ClawdisPendingAttachment] = []
|
public var attachments: [ClawdisPendingAttachment] = []
|
||||||
public private(set) var healthOK: Bool = true
|
public private(set) var healthOK: Bool = false
|
||||||
public private(set) var pendingRunCount: Int = 0
|
public private(set) var pendingRunCount: Int = 0
|
||||||
|
|
||||||
public let sessionKey: String
|
public let sessionKey: String
|
||||||
|
|
@ -89,6 +89,8 @@ public final class ClawdisChatViewModel {
|
||||||
|
|
||||||
private func bootstrap() async {
|
private func bootstrap() async {
|
||||||
self.isLoading = true
|
self.isLoading = true
|
||||||
|
self.errorText = nil
|
||||||
|
self.healthOK = false
|
||||||
defer { self.isLoading = false }
|
defer { self.isLoading = false }
|
||||||
do {
|
do {
|
||||||
do {
|
do {
|
||||||
|
|
@ -103,6 +105,7 @@ public final class ClawdisChatViewModel {
|
||||||
self.thinkingLevel = level
|
self.thinkingLevel = level
|
||||||
}
|
}
|
||||||
await self.pollHealthIfNeeded(force: true)
|
await self.pollHealthIfNeeded(force: true)
|
||||||
|
self.errorText = nil
|
||||||
} catch {
|
} catch {
|
||||||
self.errorText = error.localizedDescription
|
self.errorText = error.localizedDescription
|
||||||
chatUILogger.error("bootstrap failed \(error.localizedDescription, privacy: .public)")
|
chatUILogger.error("bootstrap failed \(error.localizedDescription, privacy: .public)")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue