mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 19:53:25 +01:00
Fixes endless loading when sideloading invalid app
This commit is contained in:
@@ -629,7 +629,7 @@ private extension MyAppsViewController
|
|||||||
|
|
||||||
let unzippedApplicationURL = try FileManager.default.unzipAppBundle(at: fileURL, toDirectory: temporaryDirectory)
|
let unzippedApplicationURL = try FileManager.default.unzipAppBundle(at: fileURL, toDirectory: temporaryDirectory)
|
||||||
|
|
||||||
guard let application = ALTApplication(fileURL: unzippedApplicationURL) else { return }
|
guard let application = ALTApplication(fileURL: unzippedApplicationURL) else { throw OperationError.invalidApp }
|
||||||
|
|
||||||
self.sideloadingProgress = AppManager.shared.install(application, presentingViewController: self) { (result) in
|
self.sideloadingProgress = AppManager.shared.install(application, presentingViewController: self) { (result) in
|
||||||
try? FileManager.default.removeItem(at: temporaryDirectory)
|
try? FileManager.default.removeItem(at: temporaryDirectory)
|
||||||
@@ -638,7 +638,7 @@ private extension MyAppsViewController
|
|||||||
if let error = result.error
|
if let error = result.error
|
||||||
{
|
{
|
||||||
let toastView = ToastView(text: error.localizedDescription, detailText: nil)
|
let toastView = ToastView(text: error.localizedDescription, detailText: nil)
|
||||||
toastView.show(in: self.view, duration: 2.0)
|
toastView.show(in: self.navigationController?.view ?? self.view, duration: 2.0)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -663,7 +663,12 @@ private extension MyAppsViewController
|
|||||||
{
|
{
|
||||||
try? FileManager.default.removeItem(at: temporaryDirectory)
|
try? FileManager.default.removeItem(at: temporaryDirectory)
|
||||||
|
|
||||||
self.navigationItem.leftBarButtonItem?.isIndicatingActivity = false
|
DispatchQueue.main.async {
|
||||||
|
self.navigationItem.leftBarButtonItem?.isIndicatingActivity = false
|
||||||
|
|
||||||
|
let toastView = ToastView(text: error.localizedDescription, detailText: nil)
|
||||||
|
toastView.show(in: self.navigationController?.view ?? self.view, duration: 2.0)
|
||||||
|
}
|
||||||
|
|
||||||
completion(.failure(error))
|
completion(.failure(error))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user