From 7b67ed65e7cbc2fc59977cd7ef681178186b38b1 Mon Sep 17 00:00:00 2001 From: Doug Date: Tue, 13 Sep 2022 13:17:44 +0100 Subject: [PATCH] Fix crash when previewing a room. --- Riot/Generated/Images.swift | 3 --- Riot/Modules/Home/AllChats/AllChatsCoordinator.swift | 2 +- Riot/Modules/Home/AllChats/AllChatsViewController.swift | 4 ++-- changelog.d/6712.bugfix | 1 + 4 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 changelog.d/6712.bugfix diff --git a/Riot/Generated/Images.swift b/Riot/Generated/Images.swift index 5b0b1d986d..6fc13773b2 100644 --- a/Riot/Generated/Images.swift +++ b/Riot/Generated/Images.swift @@ -115,8 +115,6 @@ internal class Asset: NSObject { internal static let encryptionWarning = ImageAsset(name: "encryption_warning") internal static let favouritesEmptyScreenArtwork = ImageAsset(name: "favourites_empty_screen_artwork") internal static let favouritesEmptyScreenArtworkDark = ImageAsset(name: "favourites_empty_screen_artwork_dark") - internal static let allChatRecents = ImageAsset(name: "all_chat_recents") - internal static let allChatUnreads = ImageAsset(name: "all_chat_unreads") internal static let roomActionDirectChat = ImageAsset(name: "room_action_direct_chat") internal static let roomActionFavourite = ImageAsset(name: "room_action_favourite") internal static let roomActionLeave = ImageAsset(name: "room_action_leave") @@ -124,7 +122,6 @@ internal class Asset: NSObject { internal static let roomActionNotificationMuted = ImageAsset(name: "room_action_notification_muted") internal static let roomActionPriorityHigh = ImageAsset(name: "room_action_priority_high") internal static let roomActionPriorityLow = ImageAsset(name: "room_action_priority_low") - internal static let allChatEditLayout = ImageAsset(name: "all_chat_edit_layout") internal static let allChatsEditIcon = ImageAsset(name: "all_chats_edit_icon") internal static let allChatsEmptyListPlaceholderIcon = ImageAsset(name: "all_chats_empty_list_placeholder_icon") internal static let allChatsEmptyScreenArtwork = ImageAsset(name: "all_chats_empty_screen_artwork") diff --git a/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift b/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift index 410625b026..803ef5b714 100644 --- a/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift +++ b/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift @@ -767,7 +767,7 @@ extension AllChatsCoordinator: AllChatsViewControllerDelegate { self.showRoom(withNavigationParameters: roomNavigationParameters, completion: completion) } - func allChatsViewController(_ allChatsViewController: AllChatsViewController, didSelectRoomPreviewWithParameters roomPreviewNavigationParameters: RoomPreviewNavigationParameters, completion: @escaping () -> Void) { + func allChatsViewController(_ allChatsViewController: AllChatsViewController, didSelectRoomPreviewWithParameters roomPreviewNavigationParameters: RoomPreviewNavigationParameters, completion: (() -> Void)?) { self.showRoomPreview(withNavigationParameters: roomPreviewNavigationParameters, completion: completion) } diff --git a/Riot/Modules/Home/AllChats/AllChatsViewController.swift b/Riot/Modules/Home/AllChats/AllChatsViewController.swift index 5e8f5fafd4..7d33aa1fc5 100644 --- a/Riot/Modules/Home/AllChats/AllChatsViewController.swift +++ b/Riot/Modules/Home/AllChats/AllChatsViewController.swift @@ -22,7 +22,7 @@ import Reusable protocol AllChatsViewControllerDelegate: AnyObject { func allChatsViewControllerDidCompleteAuthentication(_ allChatsViewController: AllChatsViewController) func allChatsViewController(_ allChatsViewController: AllChatsViewController, didSelectRoomWithParameters roomNavigationParameters: RoomNavigationParameters, completion: @escaping () -> Void) - func allChatsViewController(_ allChatsViewController: AllChatsViewController, didSelectRoomPreviewWithParameters roomPreviewNavigationParameters: RoomPreviewNavigationParameters, completion: @escaping () -> Void) + func allChatsViewController(_ allChatsViewController: AllChatsViewController, didSelectRoomPreviewWithParameters roomPreviewNavigationParameters: RoomPreviewNavigationParameters, completion: (() -> Void)?) func allChatsViewController(_ allChatsViewController: AllChatsViewController, didSelectContact contact: MXKContact, with presentationParameters: ScreenPresentationParameters) } @@ -869,7 +869,7 @@ extension AllChatsViewController: SplitViewMasterViewControllerProtocol { /// - Parameters: /// - parameters: the presentation parameters that contains room preview information plus display information. /// - completion: the block to execute at the end of the operation. - func selectRoomPreview(with parameters: RoomPreviewNavigationParameters, completion: @escaping () -> Void) { + func selectRoomPreview(with parameters: RoomPreviewNavigationParameters, completion: (() -> Void)?) { releaseSelectedItem() let roomPreviewData = parameters.previewData diff --git a/changelog.d/6712.bugfix b/changelog.d/6712.bugfix new file mode 100644 index 0000000000..c1276e0521 --- /dev/null +++ b/changelog.d/6712.bugfix @@ -0,0 +1 @@ +Fix a crash when previewing a room. \ No newline at end of file