Skip to content

Commit

Permalink
[ios-sdk] Fix issue where picker view contents would be cleared on to…
Browse files Browse the repository at this point in the history
…ken refresh.

Summary:
Handlers that cleared picker view controller data when session was closed were also incorrectly
clearing it when tokens were refreshed, causing the control to briefly flash to a blank list.
Data should only be cleared if the session is actually closed.

Test Plan:
- Ran Scrumptious, BooleanOG, FriendPickerSample, PlacePickerSample with token refresh timeout artificially
set to 5 seconds -- consistently repro'd bug without this fix, no repro with this fix.

Revert Plan:

Reviewers: jacl, mmarucheck, gregschechte, ayden

Reviewed By: jacl

CC: msdkexp@

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

Task ID: 1321635
  • Loading branch information
Chris Lang committed Aug 6, 2012
1 parent bb100b8 commit 613b3d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/FBFriendPickerViewController.m
Expand Up @@ -291,7 +291,8 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context {
if ([object isEqual:self.session]) {
if ([object isEqual:self.session] &&
self.session.isOpen == NO) {
[self clearData];
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/FBPlacePickerViewController.m
Expand Up @@ -404,7 +404,8 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context {
if ([object isEqual:self.session]) {
if ([object isEqual:self.session] &&
self.session.isOpen == NO) {
[self clearData];
}
}
Expand Down

0 comments on commit 613b3d5

Please sign in to comment.