diff --git a/Sources/ViewModels/SparkleUpdater.swift b/Sources/ViewModels/SparkleUpdater.swift index 42e05c6..b253942 100644 --- a/Sources/ViewModels/SparkleUpdater.swift +++ b/Sources/ViewModels/SparkleUpdater.swift @@ -10,7 +10,6 @@ final class SparkleUpdater: NSObject, ObservableObject { private let logger = Logger(subsystem: "net.24unix.iKeyMon", category: "Sparkle") private let verboseLogging: Bool @Published var logMessages: [String] = [] - @Published var showLogs: Bool = false override init() { self.verboseLogging = ProcessInfo.processInfo.environment["SPARKLE_VERBOSE_LOGGING"] == "1" diff --git a/Sources/Views/PreferencesView.swift b/Sources/Views/PreferencesView.swift index bb5fc3d..a434be8 100644 --- a/Sources/Views/PreferencesView.swift +++ b/Sources/Views/PreferencesView.swift @@ -257,64 +257,11 @@ private struct UpdatesPreferencesView: View { .foregroundColor(.secondary) .padding(.top, 4) - Divider() - .padding(.vertical, 8) - - Button(action: { sparkleUpdater.showLogs.toggle() }) { - Label(sparkleUpdater.showLogs ? "Hide Logs" : "Show Logs", systemImage: "terminal.fill") - } - - if sparkleUpdater.showLogs { - logsView - } - Spacer() } .toggleStyle(.switch) .frame(maxWidth: .infinity, alignment: .leading) } - - private var logsView: some View { - VStack(alignment: .leading, spacing: 8) { - Text("Update Logs") - .font(.caption) - .fontWeight(.semibold) - .foregroundColor(.secondary) - - ScrollView { - VStack(alignment: .leading, spacing: 4) { - if sparkleUpdater.logMessages.isEmpty { - Text("No logs yet. Check for updates to see activity.") - .font(.caption) - .foregroundColor(.secondary) - .italic() - } else { - ForEach(sparkleUpdater.logMessages, id: \.self) { message in - Text(message) - .font(.caption) - .foregroundColor(.secondary) - .lineLimit(3) - .textSelection(.enabled) - } - } - } - .frame(maxWidth: .infinity, alignment: .leading) - .padding(8) - } - .frame(height: 200) - .background(Color(nsColor: .controlBackgroundColor)) - .cornerRadius(6) - .border(.separator, width: 1) - - Button(action: { - sparkleUpdater.logMessages.removeAll() - }) { - Label("Clear Logs", systemImage: "trash") - .font(.caption) - } - .disabled(sparkleUpdater.logMessages.isEmpty) - } - } } private struct NotificationsPreferencesView: View {