Skip to content

Commit

Permalink
Addresses flicker bug in scrumptious
Browse files Browse the repository at this point in the history
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
onebit committed Sep 25, 2012
1 parent e2b10bb commit 48843a7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions samples/Scrumptious/scrumptious/SCAppDelegate.m
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ - (void)createAndPresentLoginView {


- (void)showLoginView { - (void)showLoginView {
if (self.loginViewController == nil) { if (self.loginViewController == nil) {
[self performSelector:@selector(createAndPresentLoginView) withObject:nil afterDelay:0.5f]; [self createAndPresentLoginView];
} else { } else {
[self.loginViewController loginFailed]; [self.loginViewController loginFailed];
} }
Expand Down Expand Up @@ -88,15 +88,20 @@ - (void)sessionStateChanged:(FBSession *)session
// Once the user has logged out, we want them to be looking at the root view. // Once the user has logged out, we want them to be looking at the root view.
UIViewController *topViewController = [self.navController topViewController]; UIViewController *topViewController = [self.navController topViewController];
UIViewController *modalViewController = [topViewController modalViewController]; UIViewController *modalViewController = [topViewController modalViewController];
while (modalViewController != nil) { if (modalViewController != nil) {
[topViewController dismissModalViewControllerAnimated:NO]; [topViewController dismissModalViewControllerAnimated:NO];
modalViewController = [topViewController modalViewController];
} }
[self.navController popToRootViewControllerAnimated:NO]; [self.navController popToRootViewControllerAnimated:NO];


[FBSession.activeSession closeAndClearTokenInformation]; [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; break;
default: default:
Expand Down

0 comments on commit 48843a7

Please sign in to comment.