bug-fix: be on right thread when doing UI work or accessing UI references/UIApplication

This commit is contained in:
mahee96
2026-03-02 07:34:35 +05:30
parent dfb018bb89
commit f6db823816

View File

@@ -214,10 +214,12 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
alert.addAction(UIAlertAction(title: NSLocalizedString("Continue", comment: ""), style: .default, handler: { _ in alert.addAction(UIAlertAction(title: NSLocalizedString("Continue", comment: ""), style: .default, handler: { _ in
print("Going home") print("Going home")
// Cell Shortcut // Cell Shortcut
DispatchQueue.main.async{
UIApplication.shared.open(shortcutURLonDelay, options: [:]) { _ in UIApplication.shared.open(shortcutURLonDelay, options: [:]) { _ in
print("Cell OFF Shortcut finished execution.")} print("Cell OFF Shortcut finished execution.")}
UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) UIApplication.shared.perform(#selector(NSXPCConnection.suspend))
}
})) }))
DispatchQueue.main.async { DispatchQueue.main.async {
@@ -233,11 +235,14 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
} }
} }
} }
DispatchQueue.main.async {
// Cell Shortcut // Cell Shortcut
UIApplication.shared.open(shortcutURLonDelay, options: [:]) { _ in print("Cell OFF Shortcut finished execution.")} UIApplication.shared.open(shortcutURLonDelay, options: [:]) { _ in print("Cell OFF Shortcut finished execution.")}
UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) UIApplication.shared.perform(#selector(NSXPCConnection.suspend))
} }
} }
}
do { do {
try installIPA(installedApp.bundleIdentifier) try installIPA(installedApp.bundleIdentifier)