Fix id of Items, saving
This commit is contained in:
@ -20,7 +20,7 @@ final class InsertableFileButton: ObservableObject {
|
||||
"""
|
||||
icon: \(label.icon.rawValue)
|
||||
text: \(label.value)
|
||||
file: \(file.id)
|
||||
file: \(file.identifier)
|
||||
"""
|
||||
guard let downloadedFileName else {
|
||||
return result
|
||||
@ -86,7 +86,7 @@ struct InsertableButtons: View, InsertableCommandView {
|
||||
var id: String {
|
||||
switch self {
|
||||
case .file(let file):
|
||||
return "file-\(file.file?.id ?? "none")"
|
||||
return "file-\(file.file?.identifier ?? "none")"
|
||||
case .url(let url):
|
||||
return "url-\(url.url)"
|
||||
case .event(let event):
|
||||
@ -161,7 +161,7 @@ private struct FileButtonView: View {
|
||||
var body: some View {
|
||||
HStack {
|
||||
LabelEditingView(label: $content.label)
|
||||
Button("\(content.file?.id ?? "Select file")", action: { showFileSelectionSheet = true })
|
||||
Button("\(content.file?.identifier ?? "Select file")", action: { showFileSelectionSheet = true })
|
||||
OptionalTextField("", text: $content.downloadedFileName, prompt: "Downloaded file name")
|
||||
.textFieldStyle(.roundedBorder)
|
||||
}
|
||||
|
Reference in New Issue
Block a user