Skip to content

Commit

Permalink
Simplified switch
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka committed Oct 16, 2024
1 parent 54ab544 commit 561a6b3
Showing 1 changed file with 12 additions and 30 deletions.
42 changes: 12 additions & 30 deletions Zotero/Scenes/Detail/DetailCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 561a6b3

Please sign in to comment.