mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Always asks to add source when installing app if not yet added
This commit is contained in:
@@ -337,19 +337,22 @@ private extension NewsViewController
|
||||
return
|
||||
}
|
||||
|
||||
if let installedApp = storeApp.installedApp, installedApp.isUpdateAvailable
|
||||
{
|
||||
AppManager.shared.update(installedApp, presentingViewController: self, completionHandler: finish(_:))
|
||||
}
|
||||
else
|
||||
{
|
||||
AppManager.shared.install(storeApp, presentingViewController: self, completionHandler: finish(_:))
|
||||
}
|
||||
|
||||
UIView.performWithoutAnimation {
|
||||
self.collectionView.reloadSections(IndexSet(integer: indexPath.section))
|
||||
Task<Void, Never>(priority: .userInitiated) { @MainActor in
|
||||
if let installedApp = storeApp.installedApp, installedApp.isUpdateAvailable
|
||||
{
|
||||
AppManager.shared.update(installedApp, presentingViewController: self, completionHandler: finish(_:))
|
||||
}
|
||||
else
|
||||
{
|
||||
await AppManager.shared.installAsync(storeApp, presentingViewController: self, completionHandler: finish(_:))
|
||||
}
|
||||
|
||||
UIView.performWithoutAnimation {
|
||||
self.collectionView.reloadSections(IndexSet(integer: indexPath.section))
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func finish(_ result: Result<InstalledApp, Error>)
|
||||
{
|
||||
DispatchQueue.main.async {
|
||||
|
||||
Reference in New Issue
Block a user