Hides “UPDATE” option for Patreon apps with expired pledges

This commit is contained in:
Riley Testut
2023-12-01 16:42:49 -06:00
committed by Magesh K
parent 0ad9ceaa95
commit cccbe3a80b
2 changed files with 3 additions and 3 deletions

View File

@@ -348,7 +348,7 @@ private extension AppViewController
{ {
var buttonAction: AppBannerView.AppAction? var buttonAction: AppBannerView.AppAction?
if let installedApp = self.app.installedApp, let latestVersion = self.app.latestAvailableVersion, !installedApp.matches(latestVersion) if let installedApp = self.app.installedApp, let latestVersion = self.app.latestAvailableVersion, !installedApp.matches(latestVersion), !self.app.isPledgeRequired || self.app.isPledged
{ {
// Explicitly set button action to .update if there is an update available, even if it's not supported. // Explicitly set button action to .update if there is an update available, even if it's not supported.
buttonAction = .update buttonAction = .update
@@ -492,7 +492,7 @@ extension AppViewController
{ {
if let installedApp = self.app.installedApp if let installedApp = self.app.installedApp
{ {
if let latestVersion = self.app.latestAvailableVersion, !installedApp.matches(latestVersion) if let latestVersion = self.app.latestAvailableVersion, !installedApp.matches(latestVersion), !self.app.isPledgeRequired || self.app.isPledged
{ {
self.updateApp(installedApp, to: latestVersion) self.updateApp(installedApp, to: latestVersion)
} }

View File

@@ -182,7 +182,7 @@ extension AppBannerView
{ {
// App is installed // App is installed
if installedApp.isUpdateAvailable if installedApp.isUpdateAvailable && (!storeApp.isPledgeRequired || storeApp.isPledged)
{ {
buttonAction = .update buttonAction = .update
} }