From 3ece5b5058e16bfba5ea45eb48e1fbd80bd712e7 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Fri, 5 Jun 2020 07:28:28 +0200 Subject: [PATCH] iPad: Fix collection initial screen --- ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj | 8 ++++---- .../views/collection/CollectionListView.swift | 10 +++++++--- .../ACHNBrowserUI/views/todayDashboard/TodayView.swift | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj b/ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj index ec29cda0..d188aa25 100644 --- a/ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj +++ b/ACHNBrowserUI/ACHNBrowserUI.xcodeproj/project.pbxproj @@ -1308,7 +1308,7 @@ CODE_SIGN_ENTITLEMENTS = ACHNBrowserUI/ACHNBrowserUI.entitlements; CODE_SIGN_IDENTITY = "Apple Development: Thomas Ricouard (7MB55D6BJ5)"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 060432020; + CURRENT_PROJECT_VERSION = 060512020; DEVELOPMENT_ASSET_PATHS = "\"ACHNBrowserUI/Preview Content\""; DEVELOPMENT_TEAM = Z6P74P6T99; ENABLE_PREVIEWS = YES; @@ -1318,7 +1318,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.6.4; + MARKETING_VERSION = 1.6.5; PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.ACNH; PRODUCT_NAME = "AC Helper"; PROVISIONING_PROFILE_SPECIFIER = "AC Dev"; @@ -1339,7 +1339,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 060432020; + CURRENT_PROJECT_VERSION = 060512020; DEVELOPMENT_ASSET_PATHS = "\"ACHNBrowserUI/Preview Content\""; DEVELOPMENT_TEAM = Z6P74P6T99; ENABLE_PREVIEWS = YES; @@ -1349,7 +1349,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.6.4; + MARKETING_VERSION = 1.6.5; PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.ACNH; PRODUCT_NAME = "AC Helper"; PROVISIONING_PROFILE_SPECIFIER = "AC Dev"; diff --git a/ACHNBrowserUI/ACHNBrowserUI/views/collection/CollectionListView.swift b/ACHNBrowserUI/ACHNBrowserUI/views/collection/CollectionListView.swift index 4a51541d..cc2460fa 100644 --- a/ACHNBrowserUI/ACHNBrowserUI/views/collection/CollectionListView.swift +++ b/ACHNBrowserUI/ACHNBrowserUI/views/collection/CollectionListView.swift @@ -46,10 +46,14 @@ struct CollectionListView: View { displayMode: .automatic) .sheet(item: $sheet, content: { Sheet(sheetType: $0) }) - if collection.items.isEmpty { - placeholderView + if categories.isEmpty { + List { + placeholderView + } } else { - ItemDetailView(item: collection.items.first!) + ItemsListView(category: Category(itemCategory: categories.first!), + items: collection.items + .filter({ Backend.Category(itemCategory: $0.category) == Category(itemCategory: categories.first!)})) } } } diff --git a/ACHNBrowserUI/ACHNBrowserUI/views/todayDashboard/TodayView.swift b/ACHNBrowserUI/ACHNBrowserUI/views/todayDashboard/TodayView.swift index 2c666ef9..270eb573 100644 --- a/ACHNBrowserUI/ACHNBrowserUI/views/todayDashboard/TodayView.swift +++ b/ACHNBrowserUI/ACHNBrowserUI/views/todayDashboard/TodayView.swift @@ -16,7 +16,7 @@ struct TodayView: View { // MARK: - Vars @EnvironmentObject private var uiState: UIState - + @ObservedObject private var viewModel = DashboardViewModel() @State private var selectedSheet: Sheet.SheetType?