aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS/SettingsView.swift
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-10-24 22:47:44 -0700
committerDustin Mierau <dustin@mierau.me>2025-10-24 22:47:44 -0700
commitcf113ea053334175b93770b025c1f7d22eda6eab (patch)
tree8f0037e7e9ad3aa592c8475d962d37eb0c867703 /Hotline/macOS/SettingsView.swift
parent75ebba6ad7e45e636cd5bb3400d25d040cabad6c (diff)
A first pass at chat persistence. Also some chat UI cleanup.
Diffstat (limited to 'Hotline/macOS/SettingsView.swift')
-rw-r--r--Hotline/macOS/SettingsView.swift19
1 files changed, 19 insertions, 0 deletions
diff --git a/Hotline/macOS/SettingsView.swift b/Hotline/macOS/SettingsView.swift
index 81a2f8d..d301abd 100644
--- a/Hotline/macOS/SettingsView.swift
+++ b/Hotline/macOS/SettingsView.swift
@@ -3,6 +3,7 @@ import SwiftUI
struct GeneralSettingsView: View {
@State private var username: String = ""
@State private var usernameChanged: Bool = false
+ @State private var showClearHistoryConfirmation: Bool = false
let saveTimer = Timer.publish(every: 5, on: .main, in: .common).autoconnect()
@@ -24,9 +25,27 @@ struct GeneralSettingsView: View {
preferences.username = self.username
}
}
+
+ Divider()
+
+ Button(role: .destructive) {
+ showClearHistoryConfirmation = true
+ } label: {
+ Text("Clear Chat History…")
+ }
}
.padding()
.frame(width: 392)
+ .confirmationDialog("Clear chat history?", isPresented: $showClearHistoryConfirmation, titleVisibility: .visible) {
+ Button("Clear Chat History", role: .destructive) {
+ Task {
+ await ChatStore.shared.clearAll()
+ }
+ }
+ Button("Cancel", role: .cancel) {}
+ } message: {
+ Text("This removes all saved chat logs across servers. Active chats will repopulate only with new messages.")
+ }
.onAppear {
self.username = preferences.username
self.usernameChanged = false