mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-12 19:41:11 +00:00
Refactoring
This commit is contained in:
1 parent
9fd07e9326
commit
1256b91d4f
4 files changed
+27
-16
No files matched your search
@@ -537,8 +537,12 @@ class InboundNearbyConnection: NearbyConnection {
|
||||
}
|
||||
|
||||
checkIfCanProceed(metadata: metadata)
|
||||
} else {
|
||||
rejectDueToUnsupportedFileType(frame)
|
||||
}
|
||||
else {
|
||||
log("[InboundNearbyConnection \(self.id)] Rejecting transfer due to unsupported file type. Frame is \(frame.debugDescription)")
|
||||
|
||||
lastError = NearbyError.canceled(reason: .unsupportedType)
|
||||
rejectTransfer(with: .unsupportedAttachmentType)
|
||||
}
|
||||
|
||||
|
||||
@@ -558,15 +562,6 @@ class InboundNearbyConnection: NearbyConnection {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func rejectDueToUnsupportedFileType(_ frame: Sharing_Nearby_Frame) {
|
||||
|
||||
log("[InboundNearbyConnection \(self.id)] Rejecting transfer due to unsupported file type. Frame is \(frame.debugDescription)")
|
||||
|
||||
lastError = NearbyError.canceled(reason: .unsupportedType)
|
||||
rejectTransfer(with: .unsupportedAttachmentType)
|
||||
}
|
||||
|
||||
|
||||
func submitUserConsent(accepted: Bool, trustDevice: Bool) {
|
||||
if trustDevice, let peerCertificate = peerCertificate, let remoteDeviceInfo = remoteDeviceInfo {
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
"location" : "https://github.com/leonboe1/LUI.git",
|
||||
"state" : {
|
||||
"branch" : "main",
|
||||
"revision" : "0b862decf853e1f542eeab1f8d548f8ff629deca"
|
||||
"revision" : "c971b0a42e299c6ad78e933db473342e11fd9456"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -6,13 +6,18 @@
|
||||
//
|
||||
|
||||
import LUI
|
||||
import Foundation
|
||||
|
||||
let configuration = LUIConfiguration(
|
||||
appName: "QuickDrop",
|
||||
|
||||
inAppPurchaseName: "plusversion",
|
||||
plusVersionInfo: GetPlusViewInformation(lifetimeID: "plusversion", description: "plusview_description_phone", plusVersionFeatures: [], settingsLabelColor: .orange, settingsFooter: "plusview_footer_phone"),
|
||||
|
||||
plusVersionInfo: GetPlusViewInformation(description: "plusview_description_phone", plusVersionFeatures: [], settingsLabelColor: .orange, settingsFooter: "plusview_footer_phone"),
|
||||
setPlusVersion: { result in
|
||||
DispatchQueue.main.async {
|
||||
Settings.shared.gotPlus = result
|
||||
}
|
||||
},
|
||||
|
||||
hasRoundedFont: false,
|
||||
|
||||
|
||||
@@ -99,7 +99,18 @@ struct DeviceListView: View {
|
||||
}
|
||||
}
|
||||
|
||||
if sendModel.foundDevices.isEmpty {
|
||||
var availableDevices: [RemoteDeviceInfo] {
|
||||
var devices = sendModel.foundDevices
|
||||
|
||||
if let selected = sendModel.selectedDevice,
|
||||
!devices.contains(where: { $0.id == selected.id }) {
|
||||
devices.append(selected)
|
||||
}
|
||||
|
||||
return devices
|
||||
}
|
||||
|
||||
if availableDevices.isEmpty {
|
||||
|
||||
CustomSection(header: "NoDevicesFound") {
|
||||
|
||||
@@ -127,7 +138,7 @@ struct DeviceListView: View {
|
||||
} else {
|
||||
|
||||
CustomSection(header: "AvailableDevices") {
|
||||
ForEach(sendModel.foundDevices) { device in
|
||||
ForEach(availableDevices) { device in
|
||||
|
||||
let isSelected = sendModel.selectedDevice == device
|
||||
|
||||
|
||||
Reference in new issue
Block a user