From 9e7278d327201062b6dc60d7e98e37df79216f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= Date: Sat, 22 Nov 2025 18:52:02 +0100 Subject: [PATCH] Fix: iOS share extension not detecting new devices after a while #2 --- QuickDropiOS/View/ContentView.swift | 6 +++--- iOSShareExtension/ShareViewController.swift | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/QuickDropiOS/View/ContentView.swift b/QuickDropiOS/View/ContentView.swift index b719b63..daa58a7 100644 --- a/QuickDropiOS/View/ContentView.swift +++ b/QuickDropiOS/View/ContentView.swift @@ -65,11 +65,11 @@ struct DeviceListView: View { BottomBarView(header: "QuickDrop", navigationBarLayout: isShareExtension() ? .SmallOnlyAlways : .Default, bottomViewHeight: 30) { VStack { - if nearbyConnectionManager.hasLocalNetworkPermission { + let attachments = nearbyConnectionManager.attachments + + if nearbyConnectionManager.hasLocalNetworkPermission && attachments == nil { VStack(alignment: .leading, spacing: 8) { - let attachments = nearbyConnectionManager.attachments - FormHeader(name: attachments == nil ? "YouAreVisibleAs".localized() : "YouAreSending".localized()) HStack { diff --git a/iOSShareExtension/ShareViewController.swift b/iOSShareExtension/ShareViewController.swift index 3181c5a..c13e8ef 100644 --- a/iOSShareExtension/ShareViewController.swift +++ b/iOSShareExtension/ShareViewController.swift @@ -13,6 +13,8 @@ class ShareViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() + NearbyConnectionManager.shared.stopDeviceDiscovery() + loadAttachments(with: extensionContext, loadedItems: { [self] result in log("[ShareViewController] Loaded attachments: \(result)")