mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-30 08:12:40 +00:00
Merge pull request #2391 from vector-im/fix_room_details_navigation
Fix room details navigation
This commit is contained in:
commit
f94060b7ac
5 changed files with 26 additions and 9 deletions
|
@ -145,7 +145,9 @@ extern NSString *const kAppDelegateNetworkStatusDidChangeNotification;
|
|||
#pragma mark - Matrix Room handling
|
||||
|
||||
// Show a room and jump to the given event if event id is not nil otherwise go to last messages.
|
||||
- (void)showRoom:(NSString*)roomId andEventId:(NSString*)eventId withMatrixSession:(MXSession*)mxSession completion:(void (^)(void))completion;
|
||||
- (void)showRoom:(NSString*)roomId andEventId:(NSString*)eventId withMatrixSession:(MXSession*)mxSession restoreInitialDisplay:(BOOL)restoreInitialDisplay completion:(void (^)(void))completion;
|
||||
|
||||
- (void)showRoom:(NSString*)roomId andEventId:(NSString*)eventId withMatrixSession:(MXSession*)mxSession restoreInitialDisplay:(BOOL)restoreInitialDisplay;
|
||||
|
||||
- (void)showRoom:(NSString*)roomId andEventId:(NSString*)eventId withMatrixSession:(MXSession*)mxSession;
|
||||
|
||||
|
|
|
@ -3587,10 +3587,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
|
|||
|
||||
#pragma mark - Matrix Rooms handling
|
||||
|
||||
- (void)showRoom:(NSString*)roomId andEventId:(NSString*)eventId withMatrixSession:(MXSession*)mxSession completion:(void (^)(void))completion
|
||||
- (void)showRoom:(NSString*)roomId andEventId:(NSString*)eventId withMatrixSession:(MXSession*)mxSession restoreInitialDisplay:(BOOL)restoreInitialDisplay completion:(void (^)(void))completion
|
||||
{
|
||||
[self restoreInitialDisplay:^{
|
||||
|
||||
void (^selectRoom)(void) = ^() {
|
||||
// Select room to display its details (dispatch this action in order to let TabBarController end its refresh)
|
||||
[self.masterTabBarController selectRoomWithId:roomId andEventId:eventId inMatrixSession:mxSession completion:^{
|
||||
|
||||
|
@ -3602,12 +3601,28 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
|
|||
completion();
|
||||
}
|
||||
}];
|
||||
}];
|
||||
};
|
||||
|
||||
if (restoreInitialDisplay)
|
||||
{
|
||||
[self restoreInitialDisplay:^{
|
||||
selectRoom();
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
selectRoom();
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showRoom:(NSString*)roomId andEventId:(NSString*)eventId withMatrixSession:(MXSession*)mxSession restoreInitialDisplay:(BOOL)restoreInitialDisplay
|
||||
{
|
||||
[self showRoom:roomId andEventId:eventId withMatrixSession:mxSession restoreInitialDisplay:restoreInitialDisplay completion:nil];
|
||||
}
|
||||
|
||||
- (void)showRoom:(NSString*)roomId andEventId:(NSString*)eventId withMatrixSession:(MXSession*)mxSession
|
||||
{
|
||||
[self showRoom:roomId andEventId:eventId withMatrixSession:mxSession completion:nil];
|
||||
[self showRoom:roomId andEventId:eventId withMatrixSession:mxSession restoreInitialDisplay:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)showRoomPreview:(RoomPreviewData*)roomPreviewData
|
||||
|
|
|
@ -760,7 +760,7 @@
|
|||
// Avoid multiple openings of rooms
|
||||
self.userInteractionEnabled = NO;
|
||||
|
||||
[[AppDelegate theDelegate] showRoom:roomId andEventId:nil withMatrixSession:matrixSession completion:^{
|
||||
[[AppDelegate theDelegate] showRoom:roomId andEventId:nil withMatrixSession:matrixSession restoreInitialDisplay:NO completion:^{
|
||||
self.userInteractionEnabled = YES;
|
||||
}];
|
||||
}
|
||||
|
|
|
@ -233,7 +233,7 @@
|
|||
|
||||
- (void)openRoomWithId:(NSString*)roomId inMatrixSession:(MXSession*)mxSession
|
||||
{
|
||||
[[AppDelegate theDelegate] showRoom:roomId andEventId:nil withMatrixSession:mxSession];
|
||||
[[AppDelegate theDelegate] showRoom:roomId andEventId:nil withMatrixSession:mxSession restoreInitialDisplay:NO];
|
||||
}
|
||||
|
||||
- (void)refreshCurrentSelectedCell:(BOOL)forceVisible
|
||||
|
|
|
@ -260,7 +260,7 @@
|
|||
if ([recentsDataSource.publicRoomsDirectoryDataSource.mxSession roomWithRoomId:publicRoom.roomId])
|
||||
{
|
||||
// Open the public room
|
||||
[[AppDelegate theDelegate] showRoom:publicRoom.roomId andEventId:nil withMatrixSession:recentsDataSource.publicRoomsDirectoryDataSource.mxSession];
|
||||
[[AppDelegate theDelegate] showRoom:publicRoom.roomId andEventId:nil withMatrixSession:recentsDataSource.publicRoomsDirectoryDataSource.mxSession restoreInitialDisplay:NO];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue