diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-01-03 15:40:24 -0800 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-01-03 15:40:24 -0800 |
| commit | 64368ad8690f0a071f2490e8429c0437694133ee (patch) | |
| tree | 2e0eac2130ff39498ccab2fa8f6abf905f7c5a4d /Hotline/macOS/ChatView.swift | |
| parent | 4d31accad9d6bf901928f4293f29cb62f6f77260 (diff) | |
Fix issue with username saving to server with each change in username textfield.
Diffstat (limited to 'Hotline/macOS/ChatView.swift')
| -rw-r--r-- | Hotline/macOS/ChatView.swift | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/Hotline/macOS/ChatView.swift b/Hotline/macOS/ChatView.swift index d94634a..d9e1f54 100644 --- a/Hotline/macOS/ChatView.swift +++ b/Hotline/macOS/ChatView.swift @@ -171,7 +171,6 @@ struct ChatView: View { } } .navigationTitle(self.model.serverTitle) - .navigationSubtitle(self.model.users.count > 0 ? "^[\(self.model.users.count) user](inflect: true) online" : "") .background(Color(nsColor: .textBackgroundColor)) .toolbar { ToolbarItem(placement: .primaryAction) { @@ -181,17 +180,17 @@ struct ChatView: View { } } label: { Image(systemName: "square.and.arrow.up") - }.help("Save Chat") + }.help("Save Chat...") } } - .fileExporter(isPresented: $showingExporter, document: chatDocument, contentType: .utf8PlainText, defaultFilename: "\(model.serverTitle) Chat") { result in -// switch result { -// case .success(let url): -// print("Saved to \(url)") -// -// case .failure(let error): -// print(error.localizedDescription) -// } + .fileExporter(isPresented: $showingExporter, document: self.chatDocument, contentType: .utf8PlainText, defaultFilename: "\(self.model.serverTitle) Chat.txt") { result in + switch result { + case .success(let url): + print("Saved to \(url)") + + case .failure(let error): + print(error.localizedDescription) + } self.chatDocument.text = "" } } @@ -200,7 +199,6 @@ struct ChatView: View { var text: String = String() self.chatDocument.text = "" - for msg in model.chat { if msg.type == .agreement { text.append(msg.text) |