mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-22 06:15:59 +00:00
Fix Mac Share Extension Glitch
This commit is contained in:
1 parent
2f99aee5e5
commit
643e44b307
1 file changed
+10
-1
@@ -48,6 +48,7 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
|||||||
|
|
||||||
|
|
||||||
override func loadView() {
|
override func loadView() {
|
||||||
|
|
||||||
super.loadView()
|
super.loadView()
|
||||||
loadAttachments(with: extensionContext, loadedItems: { result in
|
loadAttachments(with: extensionContext, loadedItems: { result in
|
||||||
|
|
||||||
@@ -95,6 +96,7 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
|||||||
|
|
||||||
|
|
||||||
override func viewDidLoad() {
|
override func viewDidLoad() {
|
||||||
|
|
||||||
super.viewDidLoad()
|
super.viewDidLoad()
|
||||||
|
|
||||||
dicoverDevices()
|
dicoverDevices()
|
||||||
@@ -184,6 +186,10 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
|||||||
|
|
||||||
|
|
||||||
func addDevice(device: RemoteDeviceInfo) {
|
func addDevice(device: RemoteDeviceInfo) {
|
||||||
|
|
||||||
|
if chosenDevice != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
if foundDevices.isEmpty {
|
if foundDevices.isEmpty {
|
||||||
loadingOverlay?.animator().isHidden = true
|
loadingOverlay?.animator().isHidden = true
|
||||||
}
|
}
|
||||||
@@ -195,6 +201,7 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
|||||||
|
|
||||||
|
|
||||||
func removeDevice(id: String) {
|
func removeDevice(id: String) {
|
||||||
|
|
||||||
if chosenDevice != nil {
|
if chosenDevice != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -255,7 +262,6 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
|||||||
|
|
||||||
|
|
||||||
func selectDevice(device: RemoteDeviceInfo) {
|
func selectDevice(device: RemoteDeviceInfo) {
|
||||||
NearbyConnectionManager.shared.stopDeviceDiscovery()
|
|
||||||
|
|
||||||
listViewWrapper?.animator().isHidden = true
|
listViewWrapper?.animator().isHidden = true
|
||||||
dontSeeDeviceButton?.animator().isHidden = true
|
dontSeeDeviceButton?.animator().isHidden = true
|
||||||
@@ -265,6 +271,7 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
|||||||
progressProgressBar?.startAnimation(nil)
|
progressProgressBar?.startAnimation(nil)
|
||||||
progressState?.stringValue = "Connecting".localized()
|
progressState?.stringValue = "Connecting".localized()
|
||||||
chosenDevice = device
|
chosenDevice = device
|
||||||
|
NearbyConnectionManager.shared.stopDeviceDiscovery()
|
||||||
NearbyConnectionManager.shared.startOutgoingTransfer(deviceID: device.id!, delegate: self, urls: urls, textToSend: textToSend)
|
NearbyConnectionManager.shared.startOutgoingTransfer(deviceID: device.id!, delegate: self, urls: urls, textToSend: textToSend)
|
||||||
|
|
||||||
let timeoutAlert = DispatchWorkItem {
|
let timeoutAlert = DispatchWorkItem {
|
||||||
@@ -298,6 +305,7 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
|||||||
|
|
||||||
|
|
||||||
private func dicoverDevices() {
|
private func dicoverDevices() {
|
||||||
|
|
||||||
let bundleIdentifier = "com.leonboettger.neardrop"
|
let bundleIdentifier = "com.leonboettger.neardrop"
|
||||||
let runningApps = NSWorkspace.shared.runningApplications
|
let runningApps = NSWorkspace.shared.runningApplications
|
||||||
|
|
||||||
@@ -332,6 +340,7 @@ class ShareViewController: NSViewController, OutboundAppDelegate {
|
|||||||
|
|
||||||
|
|
||||||
private func scheduleAutomaticQrCodeView() {
|
private func scheduleAutomaticQrCodeView() {
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) {
|
||||||
if self.foundDevices.isEmpty {
|
if self.foundDevices.isEmpty {
|
||||||
self.openQrCodeView()
|
self.openQrCodeView()
|
||||||
|
|||||||
Reference in new issue
Block a user