Add button to remove post
This commit is contained in:
@ -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 }
|
||||
}
|
||||
|
Reference in New Issue
Block a user