Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #105 from aaronraimist/main-thread-crash-mojave
Browse files Browse the repository at this point in the history
Fix NSInternalInconsistencyException crash by showing sheet on main thread
  • Loading branch information
neilalexander authored Dec 20, 2018
2 parents 1e1b8c5 + 67da1ac commit f697a8c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Seaglass/Controller/Main View/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ class MainViewController: NSSplitViewController, MatrixServicesDelegate {

MatrixServices.inst.session.crypto.deviceList.downloadKeys([request.userId], forceDownload: false, success: { (devicemap) in
if MatrixServices.inst.session.crypto.deviceList.storedDevice(request.userId, deviceId: request.deviceId) != nil {
let sheet = self.storyboard?.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("KeyRequest")) as! MainViewKeyRequestController
sheet.request = request
self.presentViewControllerAsSheet(sheet)
self.keyRequests.append(sheet)
DispatchQueue.main.async {
let sheet = self.storyboard?.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier("KeyRequest")) as! MainViewKeyRequestController
sheet.request = request
self.presentViewControllerAsSheet(sheet)
self.keyRequests.append(sheet)
}
}
}) { (error) in
}
Expand Down

0 comments on commit f697a8c

Please sign in to comment.