Room preview unexpectedly triggering within the room (#6255)

* Room preview unexpectedly triggering within the room

- The room creation modal is now triggered only when the user taps the room name label
- Also fix empty room creation modal view
This commit is contained in:
Gil Eluard
2022-06-10 10:41:37 +02:00
committed by GitHub
parent 51b2a1ce4d
commit ced9858a06
7 changed files with 61 additions and 27 deletions
+7 -3
View File
@@ -2034,11 +2034,11 @@ static CGSize kThreadListBarButtonItemImageSize;
self.mediaPickerPresenter = mediaPickerPresenter;
}
- (void)showRoomCreationModalWithBubbleData:(id<MXKRoomBubbleCellDataStoring>) bubbleData
- (void)showRoomCreationModal
{
[self.roomCreationModalCoordinatorBridgePresenter dismissWithAnimated:NO completion:nil];
self.roomCreationModalCoordinatorBridgePresenter = [[RoomCreationModalCoordinatorBridgePresenter alloc] initWithSession:self.mainSession bubbleData:bubbleData roomState:self.roomDataSource.roomState];
self.roomCreationModalCoordinatorBridgePresenter = [[RoomCreationModalCoordinatorBridgePresenter alloc] initWithSession:self.mainSession roomState:self.roomDataSource.roomState];
self.roomCreationModalCoordinatorBridgePresenter.delegate = self;
[self.roomCreationModalCoordinatorBridgePresenter presentFrom:self animated:YES];
}
@@ -3221,7 +3221,7 @@ static CGSize kThreadListBarButtonItemImageSize;
// Show contextual menu on single tap if bubble is not collapsed
if (bubbleData.collapsed)
{
[self showRoomCreationModalWithBubbleData:bubbleData];
// Do nothing here as we display room creation modal only if the user taps on the room name
}
else
{
@@ -3475,6 +3475,10 @@ static CGSize kThreadListBarButtonItemImageSize;
{
[self showRoomTopicChange];
}
else if ([actionIdentifier isEqualToString:RoomCreationIntroCell.tapOnRoomName])
{
[self showRoomCreationModal];
}
else
{
// Keep default implementation for other actions