mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 15:52:40 +00:00
Fix regression in previous commitment related to SYIOS-26: The app can work offline when debackgrounded but not when restarting from cold
This commit is contained in:
parent
18cc725611
commit
1f2966cdd0
1 changed files with 10 additions and 5 deletions
|
@ -117,9 +117,6 @@
|
|||
// Refresh display
|
||||
[self configureView];
|
||||
[[MatrixHandler sharedHandler] addObserver:self forKeyPath:@"isResumeDone" options:0 context:nil];
|
||||
// Add observer to force refresh when a recent last description is updated thanks to back pagination
|
||||
// (This happens when the current last event description is blank, a back pagination is triggered to display non empty description)
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(configureView) name:kRecentRoomUpdatedByBackPagination object:nil];
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
|
@ -136,7 +133,6 @@
|
|||
|
||||
_preSelectedRoomId = nil;
|
||||
[[MatrixHandler sharedHandler] removeObserver:self forKeyPath:@"isResumeDone"];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:kRecentRoomUpdatedByBackPagination object:nil];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
|
@ -228,6 +224,7 @@
|
|||
MatrixHandler *mxHandler = [MatrixHandler sharedHandler];
|
||||
|
||||
[self startActivityIndicator];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:kRecentRoomUpdatedByBackPagination object:nil];
|
||||
|
||||
if (mxHandler.mxSession) {
|
||||
// Check matrix handler status
|
||||
|
@ -334,7 +331,11 @@
|
|||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
if (!recents) {
|
||||
if (recents) {
|
||||
// Add observer to force refresh when a recent last description is updated thanks to back pagination
|
||||
// (This happens when the current last event description is blank, a back pagination is triggered to display non empty description)
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onRecentRoomUpdatedByBackPagination) name:kRecentRoomUpdatedByBackPagination object:nil];
|
||||
} else {
|
||||
// Remove potential listener
|
||||
if (recentsListener && mxHandler.mxSession) {
|
||||
[mxHandler.mxSession removeListener:recentsListener];
|
||||
|
@ -345,6 +346,10 @@
|
|||
[self updateTitleView];
|
||||
}
|
||||
|
||||
- (void)onRecentRoomUpdatedByBackPagination {
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)updateTitleView {
|
||||
NSString *title = @"Recents";
|
||||
if (unreadCount) {
|
||||
|
|
Loading…
Reference in a new issue