fix(macos): hide session store path in remote mode

This commit is contained in:
Peter Steinberger
2025-12-14 03:38:47 +00:00
parent 3729d269d0
commit efc7181aa0

View File

@@ -4,6 +4,7 @@ import SwiftUI
@MainActor @MainActor
struct SessionsSettings: View { struct SessionsSettings: View {
private let isPreview: Bool private let isPreview: Bool
@ObservedObject private var state = AppStateStore.shared
@State private var rows: [SessionRow] @State private var rows: [SessionRow]
@State private var storePath: String = SessionLoader.defaultStorePath @State private var storePath: String = SessionLoader.defaultStorePath
@State private var lastLoaded: Date? @State private var lastLoaded: Date?
@@ -62,11 +63,13 @@ struct SessionsSettings: View {
} }
} }
Spacer() Spacer()
if self.state.connectionMode == .local {
Text(self.storePath) Text(self.storePath)
.font(.caption.monospaced()) .font(.caption.monospaced())
.foregroundStyle(.secondary) .foregroundStyle(.secondary)
.multilineTextAlignment(.trailing) .multilineTextAlignment(.trailing)
} }
}
HStack(spacing: 10) { HStack(spacing: 10) {
Button { Button {
@@ -79,6 +82,7 @@ struct SessionsSettings: View {
.buttonStyle(.bordered) .buttonStyle(.bordered)
.help("Refresh session store") .help("Refresh session store")
if self.state.connectionMode == .local {
Button { Button {
self.revealStore() self.revealStore()
} label: { } label: {
@@ -86,6 +90,7 @@ struct SessionsSettings: View {
.labelStyle(.titleAndIcon) .labelStyle(.titleAndIcon)
} }
.disabled(!FileManager.default.fileExists(atPath: self.storePath)) .disabled(!FileManager.default.fileExists(atPath: self.storePath))
}
if self.loading { if self.loading {
ProgressView().controlSize(.small) ProgressView().controlSize(.small)