Преглед изворни кода

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

cyberta пре 4 година
родитељ
комит
e8df5b1f26
1 измењених фајлова са 3 додато и 1 уклоњено
  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)