mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Fixes AltStore still being refreshing even after pledge expires
This commit is contained in:
@@ -739,10 +739,29 @@ private extension MyAppsViewController
|
||||
{
|
||||
guard minimuxerStatus else { return }
|
||||
|
||||
let installedApps = InstalledApp.fetchAppsForRefreshingAll(in: DatabaseManager.shared.viewContext)
|
||||
guard !installedApps.isEmpty else {
|
||||
let error: Error
|
||||
|
||||
if let altstoreApp = InstalledApp.fetchAltStore(in: DatabaseManager.shared.viewContext),
|
||||
let storeApp = altstoreApp.storeApp, storeApp.isPledgeRequired && !storeApp.isPledged
|
||||
{
|
||||
// Assume the reason there are no apps is because we are no longer pledged to AltStore beta.
|
||||
error = OperationError(.pledgeInactive(appName: altstoreApp.name))
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, fall back to generic noInstalledApps.
|
||||
error = RefreshError(.noInstalledApps)
|
||||
}
|
||||
|
||||
let toastView = ToastView(error: error)
|
||||
toastView.show(in: self)
|
||||
return
|
||||
}
|
||||
|
||||
self.isRefreshingAllApps = true
|
||||
self.collectionView.collectionViewLayout.invalidateLayout()
|
||||
|
||||
let installedApps = InstalledApp.fetchAppsForRefreshingAll(in: DatabaseManager.shared.viewContext)
|
||||
|
||||
self.refresh(installedApps) { (result) in
|
||||
DispatchQueue.main.async {
|
||||
|
||||
@@ -267,10 +267,13 @@ public extension InstalledApp
|
||||
{
|
||||
// Refresh AltStore last since it causes app to quit.
|
||||
|
||||
if let storeApp = altStoreApp.storeApp, !storeApp.isPledgeRequired || storeApp.isPledged
|
||||
if let storeApp = altStoreApp.storeApp
|
||||
{
|
||||
// Only add AltStore if it's the public version OR if it's the beta and we're pledged to it.
|
||||
installedApps.append(altStoreApp)
|
||||
if !storeApp.isPledgeRequired || storeApp.isPledged
|
||||
{
|
||||
// Only add AltStore if it's the public version OR if it's the beta and we're pledged to it.
|
||||
installedApps.append(altStoreApp)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -302,10 +305,13 @@ public extension InstalledApp
|
||||
|
||||
if let altStoreApp = InstalledApp.fetchAltStore(in: context), altStoreApp.refreshedDate < date
|
||||
{
|
||||
if let storeApp = altStoreApp.storeApp, !storeApp.isPledgeRequired || storeApp.isPledged
|
||||
if let storeApp = altStoreApp.storeApp
|
||||
{
|
||||
// Only add AltStore if it's the public version OR if it's the beta and we're pledged to it.
|
||||
installedApps.append(altStoreApp)
|
||||
if !storeApp.isPledgeRequired || storeApp.isPledged
|
||||
{
|
||||
// Only add AltStore if it's the public version OR if it's the beta and we're pledged to it.
|
||||
installedApps.append(altStoreApp)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user