feat: hide empty entitlements

This commit is contained in:
relikd
2025-11-06 00:20:15 +01:00
parent fd13f13a3c
commit 85c1ae95c1
3 changed files with 12 additions and 10 deletions

View File

@@ -26,7 +26,13 @@ extension PreviewGenerator {
var entitlements = readEntitlements(meta, appPlist?["CFBundleExecutable"] as? String)
entitlements.applyFallbackIfNeeded(provisionPlist?["Entitlements"] as? PlistDict)
if entitlements.html == nil && !entitlements.hasError {
self.apply(["EntitlementsHidden" : CLASS_HIDDEN])
return
}
self.apply([
"EntitlementsHidden" : CLASS_VISIBLE,
"EntitlementsWarningHidden": entitlements.hasError ? CLASS_VISIBLE : CLASS_HIDDEN,
"EntitlementsDict": entitlements.html ?? "No Entitlements",
])