Skip to content

Commit

Permalink
fix: Ensure file deletion works (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbmorley authored Feb 24, 2024
1 parent e617ab0 commit d90a9fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Folders/Views/GridView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,19 @@ extension InnerGridView: InteractiveCollectionViewDelegate {
}

@objc func preview(sender: NSMenuItem) {
guard let urls = sender.representedObject as? [Details.Identifier] else {
guard let identifiers = sender.representedObject as? [Details.Identifier] else {
return
}
showPreview()
}

@objc func moveToTrash(sender: NSMenuItem) {
guard let urls = sender.representedObject as? [URL] else {
guard let identifiers = sender.representedObject as? [Details.Identifier] else {
return
}
for url in urls {
for identifier in identifiers {
do {
try FileManager.default.trashItem(at: url, resultingItemURL: nil)
try FileManager.default.trashItem(at: identifier.url, resultingItemURL: nil)
} catch {
print("Failed to trash item with error \(error).")
}
Expand Down

0 comments on commit d90a9fc

Please sign in to comment.