Add QR Code View to iOS

This commit is contained in:
Leon Böttger committed 2025-09-14 21:02:39 +02:00
1 parent a39a5a324a
commit bfc23fde15
13 files changed
+469 -173

No files matched your search

+14 -2
View File
@@ -12,6 +12,8 @@ import LUI
class SendModel: ObservableObject, OutboundAppDelegate {
@Published var showQrCodeView: Bool = false
@Published var foundDevices: [RemoteDeviceInfo] = []
@Published var selectedDevice: RemoteDeviceInfo?
@@ -94,11 +96,20 @@ class SendModel: ObservableObject, OutboundAppDelegate {
func startTransferWithQrCode(device: RemoteDeviceInfo) {
selectDevice(device: device)
showQrCodeView = false
#if EXTENSION
if let attachments = NearbyConnectionManager.shared.attachments {
self.selectDevice(device:device, with: attachments)
}
#endif
}
func selectDevice(device: RemoteDeviceInfo) {
func selectDevice(device: RemoteDeviceInfo, with attachments: AttachmentDetails) {
self.urls = attachments.urls
self.textToSend = attachments.textToSend
// already selected, cancel transfer
if device == selectedDevice {
@@ -108,6 +119,7 @@ class SendModel: ObservableObject, OutboundAppDelegate {
NearbyConnectionManager.shared.cancelOutgoingTransfer(id: device.id!)
}
else {
progressValue = 0
progressState = "Connecting".localized()
selectedDevice = device