Skip to content
Browse files

Addresses flicker bug in scrumptious

Summary:
Moves the delayed call back one frame in the stack, in order to avoid
its being active in the startup case

Test Plan: Ran the app

Reviewers: clang, chrisp

Reviewed By: clang

CC: msdkexp@

Differential Revision: https://phabricator.fb.com/D583546

Task ID: 1731992
  • Loading branch information...
1 parent e2b10bb commit 48843a77e89d38e38cfe559c4c67c019c528479e @onebit onebit committed Sep 25, 2012
Showing with 9 additions and 4 deletions.
  1. +9 −4 samples/Scrumptious/scrumptious/SCAppDelegate.m
View
13 samples/Scrumptious/scrumptious/SCAppDelegate.m
@@ -52,7 +52,7 @@ - (void)createAndPresentLoginView {
- (void)showLoginView {
if (self.loginViewController == nil) {
- [self performSelector:@selector(createAndPresentLoginView) withObject:nil afterDelay:0.5f];
+ [self createAndPresentLoginView];
} else {
[self.loginViewController loginFailed];
}
@@ -88,15 +88,20 @@ - (void)sessionStateChanged:(FBSession *)session
// Once the user has logged out, we want them to be looking at the root view.
UIViewController *topViewController = [self.navController topViewController];
UIViewController *modalViewController = [topViewController modalViewController];
- while (modalViewController != nil) {
+ if (modalViewController != nil) {
[topViewController dismissModalViewControllerAnimated:NO];
- modalViewController = [topViewController modalViewController];
}
[self.navController popToRootViewControllerAnimated:NO];
[FBSession.activeSession closeAndClearTokenInformation];
- [self showLoginView];
+ // if the token goes invalid we want to switch right back to
+ // the login view, however we do it with a slight delay in order to
+ // account for a race between this and the login view dissappearing
+ // a moment before
+ [self performSelector:@selector(showLoginView)
+ withObject:nil
+ afterDelay:0.5f];
}
break;
default:

0 comments on commit 48843a7

Please sign in to comment.
Something went wrong with that request. Please try again.