mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-22 05:03:26 +01:00
Presents confirmation alert before refreshing AltStore
This commit is contained in:
@@ -129,6 +129,8 @@ private extension MyAppsViewController
|
||||
}
|
||||
|
||||
func refresh(_ installedApps: [InstalledApp], completionHandler: @escaping (Result<[String : Result<InstalledApp, Error>], Error>) -> Void)
|
||||
{
|
||||
func refresh()
|
||||
{
|
||||
if self.refreshGroup == nil
|
||||
{
|
||||
@@ -193,6 +195,21 @@ private extension MyAppsViewController
|
||||
|
||||
self.refreshGroup = group
|
||||
}
|
||||
|
||||
if installedApps.contains(where: { $0.app.identifier == App.altstoreAppID })
|
||||
{
|
||||
let alertController = UIAlertController(title: NSLocalizedString("Refresh AltStore?", comment: ""), message: NSLocalizedString("AltStore will quit when it is finished refreshing.", comment: ""), preferredStyle: .alert)
|
||||
alertController.addAction(.cancel)
|
||||
alertController.addAction(UIAlertAction(title: NSLocalizedString("Refresh", comment: ""), style: .default) { (action) in
|
||||
refresh()
|
||||
})
|
||||
self.present(alertController, animated: true, completion: nil)
|
||||
}
|
||||
else
|
||||
{
|
||||
refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension MyAppsViewController
|
||||
|
||||
Reference in New Issue
Block a user