Skip to content

Commit

Permalink
Bugfix: Load profile in Profile tab when logging in somewhere else.
Browse files Browse the repository at this point in the history
  • Loading branch information
newsyc committed Apr 1, 2011
1 parent 47edd67 commit a6c718e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Orangey/SessionProfileController.m
Expand Up @@ -98,16 +98,20 @@ - (void)viewWillDisappear:(BOOL)animated {
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];

// XXX: because this navigation item is shown for every tab, this is a gigantic hack:
// we are removing it and adding it manually as this view is shown/hidden :(
// maybe this should be a button in the table view instead?
[[[self tabBarController] navigationItem] setLeftBarButtonItem:source != nil ? logoutItem : nil];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

// If you logged in somewhere else while this view wasn't visible,
// we should reflect that change once it does become visible.
if (source == nil && [HNSession currentSession] != nil) {
[self setSource:[[HNSession currentSession] user]];
[self performInitialLoadIfPossible];
}

[super viewWillAppear:animated];
}

- (void)loadView {
Expand Down

0 comments on commit a6c718e

Please sign in to comment.