From 62f70f4d7316eb51c688b82b049e3e83dc1a8ffd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 12:58:36 +0000 Subject: [PATCH] fix: Missing close button - WPB-14444 (#2183) Co-authored-by: Sam Wyndham --- .../ConversationListViewController+NavigationBar.swift | 5 ++++- .../Folders/FolderPickerViewControllerBuilder.swift | 4 ++-- .../MainController/SidebarViewControllerDelegate.swift | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ConversationListViewController+NavigationBar/ConversationListViewController+NavigationBar.swift b/wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ConversationListViewController+NavigationBar/ConversationListViewController+NavigationBar.swift index 6ffc850bb4b..43196283395 100644 --- a/wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ConversationListViewController+NavigationBar/ConversationListViewController+NavigationBar.swift +++ b/wire-ios/Wire-iOS/Sources/UserInterface/ConversationList/Container/ConversationListViewController+NavigationBar/ConversationListViewController+NavigationBar.swift @@ -445,7 +445,10 @@ extension ConversationListViewController: ConversationListContainerViewModelDele guard let self, let mainCoordinator else { return } Task { @MainActor [folderPickerViewControllerBuilder] in - let viewController = folderPickerViewControllerBuilder.build(mainCoordinator: mainCoordinator) + let viewController = folderPickerViewControllerBuilder.build( + mainCoordinator: mainCoordinator, + showCloseButton: true + ) if let sheet = viewController.sheetPresentationController { sheet.detents = [.medium(), .large()] sheet.prefersGrabberVisible = true diff --git a/wire-ios/Wire-iOS/Sources/UserInterface/Folders/FolderPickerViewControllerBuilder.swift b/wire-ios/Wire-iOS/Sources/UserInterface/Folders/FolderPickerViewControllerBuilder.swift index 94879e365f7..1174256f119 100644 --- a/wire-ios/Wire-iOS/Sources/UserInterface/Folders/FolderPickerViewControllerBuilder.swift +++ b/wire-ios/Wire-iOS/Sources/UserInterface/Folders/FolderPickerViewControllerBuilder.swift @@ -30,7 +30,7 @@ struct FolderPickerViewControllerBuilder { } @MainActor - func build(mainCoordinator: AnyMainCoordinator) -> UIViewController { + func build(mainCoordinator: AnyMainCoordinator, showCloseButton: Bool) -> UIViewController { let folders: [FolderPickerOption] = conversationDirectory.allFolders.compactMap { guard let id = $0.remoteIdentifier, let title = $0.name else { return nil } @@ -54,7 +54,7 @@ struct FolderPickerViewControllerBuilder { let navigationStack = NavigationStack { FolderPicker( - showCloseButton: false, + showCloseButton: showCloseButton, options: folders, helpLink: WireURLs.shared.howToAddConversationToCustomFolder, selected: selected diff --git a/wire-ios/Wire-iOS/Sources/UserInterface/MainController/SidebarViewControllerDelegate.swift b/wire-ios/Wire-iOS/Sources/UserInterface/MainController/SidebarViewControllerDelegate.swift index f2da52bdebb..511e1de0c68 100644 --- a/wire-ios/Wire-iOS/Sources/UserInterface/MainController/SidebarViewControllerDelegate.swift +++ b/wire-ios/Wire-iOS/Sources/UserInterface/MainController/SidebarViewControllerDelegate.swift @@ -51,7 +51,10 @@ final class SidebarViewControllerDelegate: WireSidebarUI.SidebarViewControllerDe @MainActor func sidebarViewController(_ viewController: SidebarViewController, didTapFoldersMenuItem frame: CGRect) { Task { - let folderPicker = folderPickerViewControllerBuilder.build(mainCoordinator: mainCoordinator) + let folderPicker = folderPickerViewControllerBuilder.build( + mainCoordinator: mainCoordinator, + showCloseButton: false + ) folderPicker.modalPresentationStyle = .popover if let popover = folderPicker.popoverPresentationController,