From f6db823816cdcbe1a40394a4c0e2fc8353bb64f4 Mon Sep 17 00:00:00 2001 From: mahee96 <47920326+mahee96@users.noreply.github.com> Date: Mon, 2 Mar 2026 07:34:35 +0530 Subject: [PATCH] bug-fix: be on right thread when doing UI work or accessing UI references/UIApplication --- AltStore/Operations/InstallAppOperation.swift | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/AltStore/Operations/InstallAppOperation.swift b/AltStore/Operations/InstallAppOperation.swift index 9e94206c..8b35df38 100644 --- a/AltStore/Operations/InstallAppOperation.swift +++ b/AltStore/Operations/InstallAppOperation.swift @@ -214,10 +214,12 @@ final class InstallAppOperation: ResultOperation alert.addAction(UIAlertAction(title: NSLocalizedString("Continue", comment: ""), style: .default, handler: { _ in print("Going home") // Cell Shortcut - UIApplication.shared.open(shortcutURLonDelay, options: [:]) { _ in - print("Cell OFF Shortcut finished execution.")} - - UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) + + DispatchQueue.main.async{ + UIApplication.shared.open(shortcutURLonDelay, options: [:]) { _ in + print("Cell OFF Shortcut finished execution.")} + UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) + } })) DispatchQueue.main.async { @@ -233,9 +235,12 @@ final class InstallAppOperation: ResultOperation } } } - // Cell Shortcut - UIApplication.shared.open(shortcutURLonDelay, options: [:]) { _ in print("Cell OFF Shortcut finished execution.")} - UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) + + DispatchQueue.main.async { + // Cell Shortcut + UIApplication.shared.open(shortcutURLonDelay, options: [:]) { _ in print("Cell OFF Shortcut finished execution.")} + UIApplication.shared.perform(#selector(NSXPCConnection.suspend)) + } } }