Skip to content

Commit

Permalink
fix: Missing close button - WPB-14444 (#2183)
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Wyndham <[email protected]>
  • Loading branch information
github-actions[bot] and samwyndham authored Nov 22, 2024
1 parent 245ed49 commit 62f70f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand All @@ -54,7 +54,7 @@ struct FolderPickerViewControllerBuilder {

let navigationStack = NavigationStack {
FolderPicker(
showCloseButton: false,
showCloseButton: showCloseButton,
options: folders,
helpLink: WireURLs.shared.howToAddConversationToCustomFolder,
selected: selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 62f70f4

Please sign in to comment.