mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
Fix URL Sharing
This commit is contained in:
1 parent
2c1c9b5e08
commit
2ee021b64d
1 file changed
+16
-15
@@ -57,21 +57,22 @@ class ShareViewController: NSViewController, ShareExtensionDelegate {
|
||||
self.zipFolderAndSetUpIcon()
|
||||
}
|
||||
} else {
|
||||
for attachment in attachments {
|
||||
if attachment.hasItemConformingToTypeIdentifier(kUTTypeURL as String) {
|
||||
attachment.loadItem(forTypeIdentifier: kUTTypeURL as String, options: nil) { data, _ in
|
||||
if let urlData = data as? Data,
|
||||
let url = URL(dataRepresentation: urlData, relativeTo: nil, isAbsolute: false)
|
||||
{
|
||||
self.urls.append(url)
|
||||
} else if let url = data as? NSURL {
|
||||
self.urls.append(url as URL)
|
||||
}
|
||||
|
||||
if self.urls.count == attachments.count {
|
||||
DispatchQueue.main.async {
|
||||
self.zipFolderAndSetUpIcon()
|
||||
}
|
||||
|
||||
let filteredAttachments = attachments.filter { $0.hasItemConformingToTypeIdentifier(kUTTypeURL as String) }
|
||||
|
||||
for attachment in filteredAttachments {
|
||||
attachment.loadItem(forTypeIdentifier: kUTTypeURL as String, options: nil) { data, _ in
|
||||
if let urlData = data as? Data,
|
||||
let url = URL(dataRepresentation: urlData, relativeTo: nil, isAbsolute: false)
|
||||
{
|
||||
self.urls.append(url)
|
||||
} else if let url = data as? NSURL {
|
||||
self.urls.append(url as URL)
|
||||
}
|
||||
|
||||
if self.urls.count == filteredAttachments.count {
|
||||
DispatchQueue.main.async {
|
||||
self.zipFolderAndSetUpIcon()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user