Add button to remove post

This commit is contained in:
Christoph Hagen
2025-05-04 11:48:09 +02:00
parent d6502fb09c
commit 329519e15b
6 changed files with 56 additions and 0 deletions

View File

@ -113,6 +113,8 @@ final class Content: ObservableObject {
loadFromDisk(callback: callback)
}
// MARK: Removing items
func remove(_ file: FileResource) {
files.remove(file)
for post in posts {
@ -129,6 +131,10 @@ final class Content: ObservableObject {
settings.remove(file)
}
func remove(_ post: Post) {
posts.remove(post)
}
func file(withOutputPath: String) -> FileResource? {
files.first { $0.absoluteUrl == withOutputPath }
}