Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when previewing a room. #6713

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Riot/Generated/Images.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,13 @@ 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")
internal static let roomActionNotification = ImageAsset(name: "room_action_notification")
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")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated but seemed worth checking in at the same time.

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")
Expand Down
2 changes: 1 addition & 1 deletion Riot/Modules/Home/AllChats/AllChatsCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions Riot/Modules/Home/AllChats/AllChatsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -854,7 +854,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
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6712.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a crash when previewing a room.