Fix id of Items, saving

This commit is contained in:
Christoph Hagen
2025-06-11 08:19:44 +02:00
parent 5970ce2e9f
commit 1d0eba9d78
64 changed files with 233 additions and 217 deletions

View File

@ -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)
}