mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Merge pull request #383 from vector-im/pop2home
Bug Fix: Room view controller is destroyed whereas it is still visible.
This commit is contained in:
commit
9f9c55d5f5
1 changed files with 9 additions and 14 deletions
|
@ -574,20 +574,6 @@ NSString *const kAppDelegateDidTapStatusBarNotification = @"kAppDelegateDidTapSt
|
|||
_homeNavigationController.delegate = self;
|
||||
|
||||
[_homeNavigationController popToViewController:_homeViewController animated:animated];
|
||||
|
||||
// For unknown reason, the navigation bar is not restored correctly by [popToViewController:animated:]
|
||||
// when a ViewController has hidden it (see MXKAttachmentsViewController).
|
||||
// Patch: restore navigation bar by default here.
|
||||
_homeNavigationController.navigationBarHidden = NO;
|
||||
|
||||
// For unknown reason, the default settings of the navigation bar are not restored correctly by [popToViewController:animated:]
|
||||
// when a ViewController has changed them (see RoomViewController, RoomMemberDetailsViewController).
|
||||
// Patch: restore default settings here.
|
||||
[_homeNavigationController.navigationBar setShadowImage:nil];
|
||||
[_homeNavigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
|
||||
|
||||
// Release the current selected room
|
||||
[_homeViewController closeSelectedRoom];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -609,6 +595,15 @@ NSString *const kAppDelegateDidTapStatusBarNotification = @"kAppDelegateDidTapSt
|
|||
if (viewController == _homeViewController)
|
||||
{
|
||||
_homeNavigationController.delegate = nil;
|
||||
|
||||
// For unknown reason, the navigation bar is not restored correctly by [popToViewController:animated:]
|
||||
// when a ViewController has hidden it (see MXKAttachmentsViewController).
|
||||
// Patch: restore navigation bar by default here.
|
||||
_homeNavigationController.navigationBarHidden = NO;
|
||||
|
||||
// Release the current selected room (if any).
|
||||
[_homeViewController closeSelectedRoom];
|
||||
|
||||
if (popToHomeViewControllerCompletion)
|
||||
{
|
||||
void (^popToHomeViewControllerCompletion2)() = popToHomeViewControllerCompletion;
|
||||
|
|
Loading…
Reference in a new issue