fix(macos): hide session store path in remote mode
This commit is contained in:
@@ -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,10 +63,12 @@ struct SessionsSettings: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
Text(self.storePath)
|
if self.state.connectionMode == .local {
|
||||||
.font(.caption.monospaced())
|
Text(self.storePath)
|
||||||
.foregroundStyle(.secondary)
|
.font(.caption.monospaced())
|
||||||
.multilineTextAlignment(.trailing)
|
.foregroundStyle(.secondary)
|
||||||
|
.multilineTextAlignment(.trailing)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HStack(spacing: 10) {
|
HStack(spacing: 10) {
|
||||||
@@ -79,13 +82,15 @@ struct SessionsSettings: View {
|
|||||||
.buttonStyle(.bordered)
|
.buttonStyle(.bordered)
|
||||||
.help("Refresh session store")
|
.help("Refresh session store")
|
||||||
|
|
||||||
Button {
|
if self.state.connectionMode == .local {
|
||||||
self.revealStore()
|
Button {
|
||||||
} label: {
|
self.revealStore()
|
||||||
Label("Reveal", systemImage: "folder")
|
} label: {
|
||||||
.labelStyle(.titleAndIcon)
|
Label("Reveal", systemImage: "folder")
|
||||||
|
.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)
|
||||||
|
|||||||
Reference in New Issue
Block a user