[FIX] Show App IDs button only if user is logged in with their Apple ID

This commit is contained in:
Fabian Thies
2023-01-31 22:35:09 +01:00
committed by Joe Mattiello
parent ed1970245a
commit d3e04c1db7
2 changed files with 21 additions and 16 deletions

View File

@@ -45,6 +45,7 @@ struct AddSourceView: View {
} }
.listStyle(InsetGroupedListStyle()) .listStyle(InsetGroupedListStyle())
.navigationTitle(L10n.AddSourceView.title) .navigationTitle(L10n.AddSourceView.title)
.navigationBarTitleDisplayMode(.inline)
} }
} }

View File

@@ -18,7 +18,9 @@ struct MyAppsView: View {
NSSortDescriptor(keyPath: \InstalledApp.storeApp?.latestVersion?.date, ascending: true), NSSortDescriptor(keyPath: \InstalledApp.storeApp?.latestVersion?.date, ascending: true),
NSSortDescriptor(keyPath: \InstalledApp.name, ascending: true) NSSortDescriptor(keyPath: \InstalledApp.name, ascending: true)
], predicate: NSPredicate(format: "%K == YES AND %K != nil AND %K != %K", ], predicate: NSPredicate(format: "%K == YES AND %K != nil AND %K != %K",
#keyPath(InstalledApp.isActive), #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.version), #keyPath(InstalledApp.storeApp.latestVersion.version))) #keyPath(InstalledApp.isActive), #keyPath(InstalledApp.storeApp),
#keyPath(InstalledApp.version), #keyPath(InstalledApp.storeApp.latestVersion.version))
)
var updates: FetchedResults<InstalledApp> var updates: FetchedResults<InstalledApp>
@@ -109,8 +111,9 @@ struct MyAppsView: View {
} }
} }
if let activeTeam = DatabaseManager.shared.activeTeam() {
VStack { VStack {
if DatabaseManager.shared.activeTeam()?.type == .free { if activeTeam.type == .free {
Text("\(remainingAppIDs) \(L10n.MyAppsView.appIDsRemaining)") Text("\(remainingAppIDs) \(L10n.MyAppsView.appIDsRemaining)")
.foregroundColor(.secondary) .foregroundColor(.secondary)
} }
@@ -127,6 +130,7 @@ struct MyAppsView: View {
} }
} }
} }
}
.padding(.horizontal) .padding(.horizontal)
} }
.background(Color(UIColor.systemGroupedBackground).ignoresSafeArea()) .background(Color(UIColor.systemGroupedBackground).ignoresSafeArea())