Retain new room creatino bridge presenter

This commit is contained in:
ismailgulek 2020-09-11 13:39:19 +03:00
parent f2d4e0174a
commit 500a80d0d0

View file

@ -34,7 +34,7 @@
#import "Riot-Swift.h"
@interface RecentsViewController ()
@interface RecentsViewController () <CreateRoomCoordinatorBridgePresenterDelegate>
{
// Tell whether a recents refresh is pending (suspended during editing mode).
BOOL isRefreshPending;
@ -66,6 +66,8 @@
id kThemeServiceDidChangeThemeNotificationObserver;
}
@property (nonatomic, strong) CreateRoomCoordinatorBridgePresenter *createRoomCoordinatorBridgePresenter;
@end
@implementation RecentsViewController
@ -1711,8 +1713,9 @@
// Sanity check
if (self.mainSession)
{
CreateRoomCoordinatorBridgePresenter *presenter = [[CreateRoomCoordinatorBridgePresenter alloc] initWithSession:self.mainSession];
[presenter presentFrom:self animated:YES];
self.createRoomCoordinatorBridgePresenter = [[CreateRoomCoordinatorBridgePresenter alloc] initWithSession:self.mainSession];
self.createRoomCoordinatorBridgePresenter.delegate = self;
[self.createRoomCoordinatorBridgePresenter presentFrom:self animated:YES];
}
}
@ -1958,4 +1961,12 @@
[self.recentsSearchBar setShowsCancelButton:NO animated:NO];
}
#pragma mark - CreateRoomCoordinatorBridgePresenterDelegate
- (void)createRoomCoordinatorBridgePresenterDelegateDidCancel:(CreateRoomCoordinatorBridgePresenter *)coordinatorBridgePresenter
{
[coordinatorBridgePresenter dismissWithAnimated:YES completion:nil];
coordinatorBridgePresenter = nil;
}
@end