mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-03 22:56:57 +02: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user