mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
Remove showCopiedToClipboardAlert
This commit is contained in:
1 parent
772de6c6e0
commit
ebfe2c3832
4 files changed
+10
-9
No files matched your search
@@ -25,7 +25,7 @@ class InboundNearbyConnection: NearbyConnection {
|
||||
private var currentState: State = .initial
|
||||
private var cipherCommitment: Data?
|
||||
private var textPayloadID: Int64 = 0
|
||||
private var isPlainTextTransfer = false
|
||||
var isPlainTextTransfer = false
|
||||
|
||||
var wasUserRejected = false
|
||||
var delegate: InboundNearbyConnectionDelegate?
|
||||
@@ -188,9 +188,6 @@ class InboundNearbyConnection: NearbyConnection {
|
||||
let pasteboard = NSPasteboard.general
|
||||
pasteboard.clearContents()
|
||||
pasteboard.setString(urlStr, forType: .string)
|
||||
|
||||
NearbyConnectionManager.shared.mainAppDelegate?.showCopiedToClipboardAlert()
|
||||
|
||||
#elseif os(iOS)
|
||||
// iOS clipboard
|
||||
UIPasteboard.general.string = urlStr
|
||||
@@ -444,7 +441,7 @@ class InboundNearbyConnection: NearbyConnection {
|
||||
let metadata = TransferMetadata(files: [], id: id, pinCode: pinCode, textDescription: textMetadata.textTitle, transferType: isClipboardText ? .text : .url)
|
||||
textPayloadID = textMetadata.payloadID
|
||||
|
||||
if isClipboardText{
|
||||
if isClipboardText {
|
||||
isPlainTextTransfer = true
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
||||
incomingConnections.removeValue(forKey: connection.id)
|
||||
|
||||
if !connection.wasUserRejected {
|
||||
mainAppDelegate?.incomingTransfer(id: connection.id, from: connection.remoteDeviceInfo ?? RemoteDeviceInfo(name: "??", type: .unknown), didFinishWith: error)
|
||||
mainAppDelegate?.connectionWasTerminated(wasPlainTextTransfer: connection.isPlainTextTransfer, from: connection.remoteDeviceInfo ?? RemoteDeviceInfo(name: "??", type: .unknown), didFinishWith: error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,8 +28,7 @@ protocol OutboundNearbyConnectionDelegate {
|
||||
|
||||
public protocol MainAppDelegate {
|
||||
func obtainUserConsent(for transfer: TransferMetadata, from device: RemoteDeviceInfo)
|
||||
func incomingTransfer(id: String, from device: RemoteDeviceInfo, didFinishWith error: Error?)
|
||||
func showCopiedToClipboardAlert()
|
||||
func connectionWasTerminated(wasPlainTextTransfer: Bool, from device: RemoteDeviceInfo, didFinishWith error: Error?)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
||||
}
|
||||
|
||||
|
||||
func incomingTransfer(id: String, from device: RemoteDeviceInfo, didFinishWith error: Error?) {
|
||||
func connectionWasTerminated(wasPlainTextTransfer: Bool, from device: RemoteDeviceInfo, didFinishWith error: Error?) {
|
||||
|
||||
if let error = error {
|
||||
|
||||
@@ -423,6 +423,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele
|
||||
|
||||
ErrorAlertHandler.shared.showErrorAlert(for: device.name ?? "Android", error: error)
|
||||
} else {
|
||||
|
||||
if wasPlainTextTransfer {
|
||||
showCopiedToClipboardAlert()
|
||||
}
|
||||
|
||||
let currentCount = transmissionCount()
|
||||
if currentCount == 0 {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
|
||||
|
||||
Reference in new issue
Block a user