From 561a6b36cd4a0313f726c4103072d6094a33cc97 Mon Sep 17 00:00:00 2001 From: Michal Rentka Date: Wed, 16 Oct 2024 14:38:23 +0200 Subject: [PATCH] Simplified switch --- Zotero/Scenes/Detail/DetailCoordinator.swift | 42 ++++++-------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/Zotero/Scenes/Detail/DetailCoordinator.swift b/Zotero/Scenes/Detail/DetailCoordinator.swift index 0cdf69f99..2bf5d14fa 100644 --- a/Zotero/Scenes/Detail/DetailCoordinator.swift +++ b/Zotero/Scenes/Detail/DetailCoordinator.swift @@ -121,37 +121,19 @@ final class DetailCoordinator: Coordinator { let controller: UIViewController switch collection.identifier { - case .custom(let type): - switch type { - case .trash: - controller = createTrashViewController( - libraryId: libraryId, - dbStorage: userControllers.dbStorage, - fileDownloader: userControllers.fileDownloader, - schemaController: controllers.schemaController, - fileStorage: controllers.fileStorage, - urlDetector: controllers.urlDetector, - itemsTagFilterDelegate: itemsTagFilterDelegate, - htmlAttributedStringConverter: controllers.htmlAttributedStringConverter - ) - - case .all, .publications, .unfiled: - controller = createItemsViewController( - collection: collection, - libraryId: libraryId, - dbStorage: userControllers.dbStorage, - fileDownloader: userControllers.fileDownloader, - remoteFileDownloader: userControllers.remoteFileDownloader, - identifierLookupController: userControllers.identifierLookupController, - syncScheduler: userControllers.syncScheduler, - citationController: userControllers.citationController, - fileCleanupController: userControllers.fileCleanupController, - itemsTagFilterDelegate: itemsTagFilterDelegate, - htmlAttributedStringConverter: controllers.htmlAttributedStringConverter - ) - } + case .custom(let type) where type == .trash: + controller = createTrashViewController( + libraryId: libraryId, + dbStorage: userControllers.dbStorage, + fileDownloader: userControllers.fileDownloader, + schemaController: controllers.schemaController, + fileStorage: controllers.fileStorage, + urlDetector: controllers.urlDetector, + itemsTagFilterDelegate: itemsTagFilterDelegate, + htmlAttributedStringConverter: controllers.htmlAttributedStringConverter + ) - case .collection, .search: + case .collection, .search, .custom: controller = createItemsViewController( collection: collection, libraryId: libraryId,