If text fails to fetch, tapping the text button should not change the text lock.

This commit is contained in:
Samuel Clay 2015-03-11 18:51:35 -07:00
parent c25fe7cecc
commit 9694d93538

View file

@ -569,7 +569,7 @@
ABS(newIndex - self.scrollingToPage) <= 1) {
[pageController initStory];
[pageController drawStory];
NSLog(@"In text view render? %d", appDelegate.inTextView);
// NSLog(@"In text view render? %d", appDelegate.inTextView);
if (appDelegate.inTextView) {
[pageController fetchTextView];
}
@ -1008,9 +1008,14 @@
- (IBAction)toggleTextView:(id)sender {
[self endTouchDown:sender];
NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults];
if ([appDelegate.storiesCollection.activeStoryView isEqualToString:@"story"]) {
[userPreferences setObject:@"text" forKey:[appDelegate.storiesCollection storyViewKey]];
BOOL failedText = [appDelegate.storiesCollection.activeStoryView isEqualToString:@"text"] &&
!currentPage.inTextView;
if (!currentPage.inTextView) {
if (!failedText) {
// Only lock in Text view if not a failed text fetch
[userPreferences setObject:@"text" forKey:[appDelegate.storiesCollection storyViewKey]];
}
appDelegate.inTextView = YES;
[self.currentPage fetchTextView];
[self.nextPage fetchTextView];