From d3e04c1db711a21aab843ba02242fa16ac437dee Mon Sep 17 00:00:00 2001 From: Fabian Thies Date: Tue, 31 Jan 2023 22:35:09 +0100 Subject: [PATCH] [FIX] Show App IDs button only if user is logged in with their Apple ID --- AltStore/Views/Browse/AddSourceView.swift | 1 + AltStore/Views/My Apps/MyAppsView.swift | 36 +++++++++++++---------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/AltStore/Views/Browse/AddSourceView.swift b/AltStore/Views/Browse/AddSourceView.swift index 0f7c9325..24ee83d9 100644 --- a/AltStore/Views/Browse/AddSourceView.swift +++ b/AltStore/Views/Browse/AddSourceView.swift @@ -45,6 +45,7 @@ struct AddSourceView: View { } .listStyle(InsetGroupedListStyle()) .navigationTitle(L10n.AddSourceView.title) + .navigationBarTitleDisplayMode(.inline) } } diff --git a/AltStore/Views/My Apps/MyAppsView.swift b/AltStore/Views/My Apps/MyAppsView.swift index c35cfde7..f2567958 100644 --- a/AltStore/Views/My Apps/MyAppsView.swift +++ b/AltStore/Views/My Apps/MyAppsView.swift @@ -18,7 +18,9 @@ struct MyAppsView: View { NSSortDescriptor(keyPath: \InstalledApp.storeApp?.latestVersion?.date, ascending: true), NSSortDescriptor(keyPath: \InstalledApp.name, ascending: true) ], 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 @@ -108,21 +110,23 @@ struct MyAppsView: View { self.rowView(for: app) } } - - VStack { - if DatabaseManager.shared.activeTeam()?.type == .free { - Text("\(remainingAppIDs) \(L10n.MyAppsView.appIDsRemaining)") - .foregroundColor(.secondary) - } - - SwiftUI.Button { - self.isShowingAppIDsView = true - } label: { - Text(L10n.MyAppsView.viewAppIDs) - } - .sheet(isPresented: self.$isShowingAppIDsView) { - NavigationView { - AppIDsView() + + if let activeTeam = DatabaseManager.shared.activeTeam() { + VStack { + if activeTeam.type == .free { + Text("\(remainingAppIDs) \(L10n.MyAppsView.appIDsRemaining)") + .foregroundColor(.secondary) + } + + SwiftUI.Button { + self.isShowingAppIDsView = true + } label: { + Text(L10n.MyAppsView.viewAppIDs) + } + .sheet(isPresented: self.$isShowingAppIDsView) { + NavigationView { + AppIDsView() + } } } }