Jelajahi Sumber

always call UIApplication.shared.open() from UI thread

cyberta 4 tahun lalu
induk
melakukan
e8df5b1f26
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 3 1
      deltachat-ios/Chat/ChatViewController.swift

+ 3 - 1
deltachat-ios/Chat/ChatViewController.swift

@@ -1187,7 +1187,9 @@ class ChatViewController: UITableViewController {
                                     let messageId = self.dcContext.sendVideoChatInvitation(chatId: self.chatId)
                                     let inviteMessage = self.dcContext.getMessage(id: messageId)
                                     if let url = NSURL(string: inviteMessage.getVideoChatUrl()) {
-                                        UIApplication.shared.open(url as URL)
+                                        DispatchQueue.main.async {
+                                            UIApplication.shared.open(url as URL)
+                                        }
                                     }
                                 }})
         alert.addAction(ok)