BugFix: App crashes on iPhone 6S in case of rotation on login screen.

Previous fix was incomplete (https://github.com/vector-im/vector-ios/commit/f1b0917a8763647725bee805e8e750129191d700)
This commit is contained in:
giomfo
2016-04-01 16:35:55 +02:00
parent d0a73d7e57
commit 2e1aed9254
+10 -7
View File
@@ -280,14 +280,14 @@
[super viewDidAppear:animated];
// Observe network reachability
[[AppDelegate theDelegate] addObserver:self forKeyPath:@"isOffline" options:0 context:nil];
[self refreshActivitiesViewDisplay];
if (self.roomDataSource)
{
// Set visible room id
[AppDelegate theDelegate].visibleRoomId = self.roomDataSource.roomId;
// Observe network reachability
[[AppDelegate theDelegate] addObserver:self forKeyPath:@"isOffline" options:0 context:nil];
[self refreshActivitiesViewDisplay];
}
}
@@ -295,10 +295,13 @@
{
[super viewDidDisappear:animated];
[[AppDelegate theDelegate] removeObserver:self forKeyPath:@"isOffline"];
// Reset visible room id
[AppDelegate theDelegate].visibleRoomId = nil;
if ([AppDelegate theDelegate].visibleRoomId)
{
[AppDelegate theDelegate].visibleRoomId = nil;
[[AppDelegate theDelegate] removeObserver:self forKeyPath:@"isOffline"];
}
}
- (void)viewDidLayoutSubviews