mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-29 10:26:46 +00:00
fix pasteboardHasURLs, disable paste button based on it
This commit is contained in:
@@ -38,7 +38,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
|
||||
}
|
||||
|
||||
@objc func pasteboardChanged() {
|
||||
ChatModel.shared.pasteboardHasURLs = UIPasteboard.general.hasStrings
|
||||
ChatModel.shared.pasteboardHasURLs = UIPasteboard.general.hasURLs
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
|
||||
|
||||
@@ -95,7 +95,7 @@ final class ChatModel: ObservableObject {
|
||||
@Published var draftChatId: String?
|
||||
// tracks keyboard height via subscription in AppDelegate
|
||||
@Published var keyboardHeight: CGFloat = 0
|
||||
@Published var pasteboardHasURLs: Bool = UIPasteboard.general.hasStrings
|
||||
@Published var pasteboardHasURLs: Bool = UIPasteboard.general.hasURLs
|
||||
|
||||
var messageDelivery: Dictionary<Int64, () -> Void> = [:]
|
||||
|
||||
|
||||
@@ -279,7 +279,6 @@ struct ChatListSearchBar: View {
|
||||
@Binding var searchShowingSimplexLink: Bool
|
||||
@Binding var searchChatFilteredBySimplexLink: String?
|
||||
@State private var ignoreSearchTextChange = false
|
||||
@State private var pasteboardHasString = false
|
||||
@State private var showScanCodeSheet = false
|
||||
@State private var alert: PlanAndConnectAlert?
|
||||
@State private var sheet: PlanAndConnectActionSheet?
|
||||
|
||||
@@ -344,6 +344,7 @@ private struct ConnectView: View {
|
||||
} label: {
|
||||
Text("Tap to paste link")
|
||||
}
|
||||
.disabled(!ChatModel.shared.pasteboardHasURLs)
|
||||
.frame(maxWidth: .infinity, alignment: .center)
|
||||
} else {
|
||||
linkTextView(pastedLink)
|
||||
|
||||
Reference in New Issue
Block a user