mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
- Lists beta versions of apps when signed in to Patreon - Lists names of Patrons with the Credits benefit
53 lines
1.5 KiB
Swift
53 lines
1.5 KiB
Swift
//
|
|
// LaunchViewController.swift
|
|
// AltStore
|
|
//
|
|
// Created by Riley Testut on 7/30/19.
|
|
// Copyright © 2019 Riley Testut. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
import Roxas
|
|
|
|
class LaunchViewController: RSTLaunchViewController
|
|
{
|
|
override var launchConditions: [RSTLaunchCondition] {
|
|
let isDatabaseStarted = RSTLaunchCondition(condition: { DatabaseManager.shared.isStarted }) { (completionHandler) in
|
|
DatabaseManager.shared.start(completionHandler: completionHandler)
|
|
}
|
|
|
|
return [isDatabaseStarted]
|
|
}
|
|
}
|
|
|
|
extension LaunchViewController
|
|
{
|
|
override func handleLaunchError(_ error: Error)
|
|
{
|
|
do
|
|
{
|
|
throw error
|
|
}
|
|
catch let error as NSError
|
|
{
|
|
let title = error.userInfo[NSLocalizedFailureErrorKey] as? String ?? NSLocalizedString("Unable to Launch AltStore", comment: "")
|
|
|
|
let alertController = UIAlertController(title: title, message: error.localizedDescription, preferredStyle: .alert)
|
|
alertController.addAction(UIAlertAction(title: NSLocalizedString("Retry", comment: ""), style: .default, handler: { (action) in
|
|
self.handleLaunchConditions()
|
|
}))
|
|
self.present(alertController, animated: true, completion: nil)
|
|
}
|
|
}
|
|
|
|
override func finishLaunching()
|
|
{
|
|
super.finishLaunching()
|
|
|
|
AppManager.shared.update()
|
|
PatreonAPI.shared.refreshPatreonAccount()
|
|
|
|
self.performSegue(withIdentifier: "finishLaunching", sender: nil)
|
|
}
|
|
}
|