Re-enables checking if Patreon account is a patron

This commit is contained in:
Riley Testut
2019-09-25 00:53:36 -07:00
parent 865e3778b8
commit 1504a277d5
4 changed files with 7 additions and 7 deletions

View File

@@ -151,7 +151,7 @@ private extension BrowseViewController
func updateDataSource() func updateDataSource()
{ {
if let patreonAccount = DatabaseManager.shared.patreonAccount(), patreonAccount.isPatron if let patreonAccount = DatabaseManager.shared.patreonAccount(), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
{ {
self.dataSource.predicate = nil self.dataSource.predicate = nil
} }

View File

@@ -84,7 +84,7 @@ extension InstalledApp
{ {
var predicate = NSPredicate(format: "%K != %@", #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID) var predicate = NSPredicate(format: "%K != %@", #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
if let patreonAccount = DatabaseManager.shared.patreonAccount(in: context), patreonAccount.isPatron if let patreonAccount = DatabaseManager.shared.patreonAccount(in: context), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
{ {
// No additional predicate // No additional predicate
} }
@@ -116,7 +116,7 @@ extension InstalledApp
#keyPath(InstalledApp.refreshedDate), date as NSDate, #keyPath(InstalledApp.refreshedDate), date as NSDate,
#keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID) #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
if let patreonAccount = DatabaseManager.shared.patreonAccount(in: context), patreonAccount.isPatron if let patreonAccount = DatabaseManager.shared.patreonAccount(in: context), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
{ {
// No additional predicate // No additional predicate
} }

View File

@@ -54,12 +54,12 @@ class PatreonAccount: NSManagedObject, Fetchable
if let patronResponse = response.included?.first if let patronResponse = response.included?.first
{ {
_ = Patron(response: patronResponse) let patron = Patron(response: patronResponse)
self.isPatron = true self.isPatron = (patron.status == .active)
} }
else else
{ {
self.isPatron = true self.isPatron = false
} }
} }
} }

View File

@@ -320,7 +320,7 @@ private extension MyAppsViewController
func updateDataSource() func updateDataSource()
{ {
if let patreonAccount = DatabaseManager.shared.patreonAccount(), patreonAccount.isPatron if let patreonAccount = DatabaseManager.shared.patreonAccount(), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
{ {
self.dataSource.predicate = nil self.dataSource.predicate = nil
} }