mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Disables actions for Patreon apps with expired pledges instead of hiding them
This commit is contained in:
@@ -1895,18 +1895,30 @@ extension MyAppsViewController
|
|||||||
let error = OperationError.pledgeInactive(appName: installedApp.name)
|
let error = OperationError.pledgeInactive(appName: installedApp.name)
|
||||||
title = error.localizedDescription
|
title = error.localizedDescription
|
||||||
|
|
||||||
// Limit options for apps requiring pledges that we are no longer pledged to.
|
let allowedActions: Set<UIMenuElement> = [
|
||||||
actions = actions.filter {
|
openMenu,
|
||||||
$0 == openMenu ||
|
deactivateAction,
|
||||||
$0 == deactivateAction ||
|
removeAction,
|
||||||
$0 == removeAction ||
|
backupAction,
|
||||||
$0 == backupAction ||
|
exportBackupAction
|
||||||
$0 == exportBackupAction ||
|
]
|
||||||
($0 == refreshAction && storeApp.bundleIdentifier == StoreApp.altstoreAppID) // Always show refresh option for AltStore so the menu will be shown.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable refresh action for AltStore.
|
for action in actions where !allowedActions.contains(action)
|
||||||
refreshAction.attributes = .disabled
|
{
|
||||||
|
// Disable options for Patreon apps that we are no longer pledged to.
|
||||||
|
|
||||||
|
if let action = action as? UIAction
|
||||||
|
{
|
||||||
|
action.attributes = .disabled
|
||||||
|
}
|
||||||
|
else if let menu = action as? UIMenu
|
||||||
|
{
|
||||||
|
for case let action as UIAction in menu.children
|
||||||
|
{
|
||||||
|
action.attributes = .disabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let menu = UIMenu(title: title ?? "", children: actions)
|
let menu = UIMenu(title: title ?? "", children: actions)
|
||||||
|
|||||||
Reference in New Issue
Block a user