Add possible fixes for the ‘empty home view’ issue.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-07-14 13:20:00 -04:00
parent 5e58079e13
commit 3f805cd4cd

View file

@ -364,7 +364,6 @@
[self updateInboxCountLabel]; [self updateInboxCountLabel];
self.isViewVisible = YES; self.isViewVisible = YES;
[self checkIfEmptyView];
// When returning to home view, try to ensure that the "last" thread is still // When returning to home view, try to ensure that the "last" thread is still
// visible. The threads often change ordering while in conversation view due // visible. The threads often change ordering while in conversation view due
@ -384,6 +383,8 @@
animated:NO]; animated:NO];
} }
} }
[self checkIfEmptyView];
} }
- (void)viewWillDisappear:(BOOL)animated - (void)viewWillDisappear:(BOOL)animated
@ -438,6 +439,8 @@
} else { } else {
[[NSNotificationCenter defaultCenter] removeObserver:self name:YapDatabaseModifiedNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:YapDatabaseModifiedNotification object:nil];
} }
[self checkIfEmptyView];
} }
- (void)applicationWillEnterForeground:(NSNotification *)notification - (void)applicationWillEnterForeground:(NSNotification *)notification
@ -846,6 +849,7 @@
[self updateInboxCountLabel]; [self updateInboxCountLabel];
if ([sectionChanges count] == 0 && [rowChanges count] == 0) { if ([sectionChanges count] == 0 && [rowChanges count] == 0) {
[self checkIfEmptyView];
return; return;
} }
@ -902,6 +906,13 @@
[self checkIfEmptyView]; [self checkIfEmptyView];
} }
- (void)setViewingThreadsIn:(CellState)viewingThreadsIn
{
_viewingThreadsIn = viewingThreadsIn;
[self checkIfEmptyView];
}
- (void)checkIfEmptyView { - (void)checkIfEmptyView {
[_tableView setHidden:NO]; [_tableView setHidden:NO];
[_emptyBoxLabel setHidden:NO]; [_emptyBoxLabel setHidden:NO];