Fix file deletion
This commit is contained in:
@@ -123,6 +123,22 @@ final class Content: ObservableObject {
|
||||
|
||||
func remove(_ file: FileResource) {
|
||||
files.remove(file)
|
||||
#warning("Remove file from required files, thumbnails, post images, etc.")
|
||||
for post in posts {
|
||||
post.remove(file)
|
||||
}
|
||||
|
||||
for page in pages {
|
||||
page.remove(file)
|
||||
}
|
||||
|
||||
for tag in tags {
|
||||
tag.remove(file)
|
||||
}
|
||||
settings.remove(file)
|
||||
#warning("Remove MainView.selectedFile when deleting file")
|
||||
}
|
||||
|
||||
func file(withOutputPath: String) -> FileResource? {
|
||||
files.first { $0.absoluteUrl == withOutputPath }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user