fix loading chat, contact connection status info (#277)

This commit is contained in:
Evgeny Poberezkin
2022-02-07 10:36:11 +00:00
committed by GitHub
parent 7883ca7657
commit eeea33c7cb
6 changed files with 80 additions and 20 deletions
+13 -3
View File
@@ -237,9 +237,19 @@ final class Chat: ObservableObject, Identifiable {
var statusString: String {
get {
switch self {
case .connected: return "Connected to contact's server"
case let .error(err): return "Connecting to contact's server… (error: \(err))"
default: return "Connecting to contact's server…"
case .connected: return "Server connected"
case let .error(err): return "Connecting server… (error: \(err))"
default: return "Connecting server…"
}
}
}
var statusExplanation: String {
get {
switch self {
case .connected: return "You are connected to the server you use to receve messages from this contact."
case let .error(err): return "Trying to connect to the server you use to receve messages from this contact (error: \(err))."
default: return "Trying to connect to the server you use to receve messages from this contact."
}
}
}
-1
View File
@@ -187,7 +187,6 @@ enum TerminalItem: Identifiable {
func chatSendCmd(_ cmd: ChatCommand) throws -> ChatResponse {
var c = cmd.cmdString.cString(using: .utf8)!
print("command", cmd.cmdString)
// TODO some mechanism to update model without passing it - maybe Publisher / Subscriber?
// DispatchQueue.main.async {
// termId += 1