From 225bbbe7af7150374b8d921aba7dba864f7b27b9 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Tue, 10 Sep 2019 12:32:48 -0700 Subject: [PATCH] Fixes sideloaded apps disappearing after unlinking Patreon --- AltStore/Model/InstalledApp.swift | 6 ++++-- AltStore/My Apps/MyAppsViewController.swift | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/AltStore/Model/InstalledApp.swift b/AltStore/Model/InstalledApp.swift index 2bf7a29b..1c1c9add 100644 --- a/AltStore/Model/InstalledApp.swift +++ b/AltStore/Model/InstalledApp.swift @@ -90,7 +90,8 @@ extension InstalledApp } else { - predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, NSPredicate(format: "%K == NO", #keyPath(InstalledApp.storeApp.isBeta))]) + predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, + NSPredicate(format: "%K == nil OR %K == NO", #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.isBeta))]) } var installedApps = InstalledApp.all(satisfying: predicate, @@ -121,7 +122,8 @@ extension InstalledApp } else { - predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, NSPredicate(format: "%K == NO", #keyPath(InstalledApp.storeApp.isBeta))]) + predicate = NSCompoundPredicate(andPredicateWithSubpredicates: [predicate, + NSPredicate(format: "%K == nil OR %K == NO", #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.isBeta))]) } var installedApps = InstalledApp.all(satisfying: predicate, diff --git a/AltStore/My Apps/MyAppsViewController.swift b/AltStore/My Apps/MyAppsViewController.swift index f3f6ac3a..fbdcf08f 100644 --- a/AltStore/My Apps/MyAppsViewController.swift +++ b/AltStore/My Apps/MyAppsViewController.swift @@ -313,7 +313,7 @@ private extension MyAppsViewController } else { - self.dataSource.predicate = NSPredicate(format: "%K != nil AND %K == NO", #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.isBeta)) + self.dataSource.predicate = NSPredicate(format: "%K == nil OR %K == NO", #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.isBeta)) } } }