From fdc19b6f621966d16b915ab0ae0ad22ea4df38df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= Date: Sat, 22 Nov 2025 16:08:11 +0100 Subject: [PATCH] Fix: iOS share extension not detecting new devices after a while --- QuickDrop.xcodeproj/project.pbxproj | 8 ++++---- QuickDrop/ViewModel/ReceiveModel.swift | 10 ++++++---- QuickDropiOS/View/ContentView.swift | 7 ------- iOSShareExtension/ShareViewController.swift | 11 +++++++++-- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/QuickDrop.xcodeproj/project.pbxproj b/QuickDrop.xcodeproj/project.pbxproj index 12bec81..8b03f59 100644 --- a/QuickDrop.xcodeproj/project.pbxproj +++ b/QuickDrop.xcodeproj/project.pbxproj @@ -1321,8 +1321,8 @@ MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; - SHARED_BUILD = 90; - SHARED_VERSION = 2.6.1; + SHARED_BUILD = 91; + SHARED_VERSION = 2.7.1; STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_EMIT_LOC_STRINGS = YES; @@ -1384,8 +1384,8 @@ MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; - SHARED_BUILD = 90; - SHARED_VERSION = 2.6.1; + SHARED_BUILD = 91; + SHARED_VERSION = 2.7.1; STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/QuickDrop/ViewModel/ReceiveModel.swift b/QuickDrop/ViewModel/ReceiveModel.swift index 6602a4a..1237240 100644 --- a/QuickDrop/ViewModel/ReceiveModel.swift +++ b/QuickDrop/ViewModel/ReceiveModel.swift @@ -197,14 +197,14 @@ class ReceiveModel: ObservableObject, InboundAppDelegate { #if os(iOS) errorVibration() + #else + DispatchQueue.main.async { + self.hideQuickDropToast() + } #endif controlPlusScreen(false) ErrorAlertHandler.shared.showErrorAlert(for: device.name ?? "Android", error: error) - - DispatchQueue.main.async { - self.hideQuickDropToast() - } } else { #if os(iOS) @@ -288,6 +288,7 @@ class ReceiveModel: ObservableObject, InboundAppDelegate { } } + #if os(macOS) func showReviewIfAppropriate(currentTransmissionCount: Int) { // If distributed directly, do not request review here as it does not work if pendingReview && !DistributionDetector.isDirectDistributionEnabled { @@ -300,6 +301,7 @@ class ReceiveModel: ObservableObject, InboundAppDelegate { } } } + #endif } diff --git a/QuickDropiOS/View/ContentView.swift b/QuickDropiOS/View/ContentView.swift index 9f5bc19..b719b63 100644 --- a/QuickDropiOS/View/ContentView.swift +++ b/QuickDropiOS/View/ContentView.swift @@ -74,13 +74,6 @@ struct DeviceListView: View { HStack { - if let image = attachments?.previewImage { - image - .resizable() - .scaledToFill() - .frame(width: 10, height: 10) - } - LUIText(attachments?.shortDescription ?? NearbyConnectionManager.shared.deviceInfo.name ?? "Unknown".localized(), isBold: true) .lineLimit(1) } diff --git a/iOSShareExtension/ShareViewController.swift b/iOSShareExtension/ShareViewController.swift index bbf6a51..3181c5a 100644 --- a/iOSShareExtension/ShareViewController.swift +++ b/iOSShareExtension/ShareViewController.swift @@ -15,7 +15,7 @@ class ShareViewController: UIViewController { loadAttachments(with: extensionContext, loadedItems: { [self] result in - log("ShareViewController: Loaded attachments: \(result)") + log("[ShareViewController] Loaded attachments: \(result)") var attachmentDetails = result attachmentDetails.closeView = { [weak self] in @@ -48,5 +48,12 @@ class ShareViewController: UIViewController { hostingController.didMove(toParent: self) } + + + override func viewDidDisappear(_ animated: Bool) { + NearbyConnectionManager.shared.stopDeviceDiscovery() + + super.viewDidDisappear(animated) + log("[ShareViewController] Disappeared view.") + } } -