Skip to content

Commit d1933cb

Browse files
committed
fix: add correct path when dragging file onto folder on macOS
Signed-off-by: Tommy van der Vorst <tommy@pixelspark.nl>
1 parent 271bbc9 commit d1933cb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Sushitrain/BrowserView.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,16 +410,13 @@ struct BrowserView: View {
410410

411411
// Select the dropped file
412412
if folder.isSelective() {
413-
let localURL = URL(fileURLWithPath: self.prefix).appendingPathComponent(
414-
url.lastPathComponent, isDirectory: false)
415-
// Soft fail because we may be scanning or syncing
416-
pathsToSelect.append(localURL.path(percentEncoded: false))
413+
let localURL = self.prefix.withoutEndingSlash + "/" + url.lastPathComponent
414+
pathsToSelect.append(localURL)
417415
}
418416
}
419417

420418
if folder.isSelective() {
421-
try self.folder.setLocalPathsExplicitlySelected(
422-
SushitrainListOfStrings.from(pathsToSelect))
419+
try self.folder.setLocalPathsExplicitlySelected(SushitrainListOfStrings.from(pathsToSelect))
423420
}
424421

425422
try self.folder.rescanSubdirectory(self.prefix)

0 commit comments

Comments
 (0)