Improve storage
This commit is contained in:
@ -6,19 +6,15 @@ struct FolderOnDiskPropertyView: View {
|
||||
let title: LocalizedStringKey
|
||||
|
||||
@Binding
|
||||
var folder: URL?
|
||||
|
||||
@Binding
|
||||
var isStale: Bool
|
||||
var folder: SecurityBookmark?
|
||||
|
||||
let footer: LocalizedStringKey
|
||||
|
||||
let update: (URL) -> Void
|
||||
|
||||
init(title: LocalizedStringKey, folder: Binding<URL?>, isStale: Binding<Bool>, footer: LocalizedStringKey, update: @escaping (URL) -> Void) {
|
||||
init(title: LocalizedStringKey, folder: Binding<SecurityBookmark?>, footer: LocalizedStringKey, update: @escaping (URL) -> Void) {
|
||||
self.title = title
|
||||
self._folder = folder
|
||||
self._isStale = isStale
|
||||
self.footer = footer
|
||||
self.update = update
|
||||
}
|
||||
@ -29,7 +25,7 @@ struct FolderOnDiskPropertyView: View {
|
||||
HStack(alignment: .firstTextBaseline) {
|
||||
Text(title)
|
||||
.font(.headline)
|
||||
if isStale {
|
||||
if folder == nil || folder?.isStale == true {
|
||||
Image(systemSymbol: .exclamationmarkTriangle)
|
||||
.foregroundStyle(.yellow)
|
||||
}
|
||||
@ -43,7 +39,7 @@ struct FolderOnDiskPropertyView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
Text(folder?.path() ?? "No folder selected")
|
||||
Text(folder?.url.path() ?? "No folder selected")
|
||||
.padding(.bottom, 5)
|
||||
Text(footer)
|
||||
.foregroundStyle(.secondary)
|
||||
|
Reference in New Issue
Block a user