summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers/FeedViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/ViewControllers/FeedViewController.m')
-rw-r--r--Juick/ViewControllers/FeedViewController.m23
1 files changed, 17 insertions, 6 deletions
diff --git a/Juick/ViewControllers/FeedViewController.m b/Juick/ViewControllers/FeedViewController.m
index f6e36f4..ce08178 100644
--- a/Juick/ViewControllers/FeedViewController.m
+++ b/Juick/ViewControllers/FeedViewController.m
@@ -12,6 +12,7 @@
#import "MessageCell.h"
#import "APIClient.h"
#import "AppDelegate.h"
+#import "LoginViewController.h"
@interface FeedViewController ()
@@ -23,14 +24,10 @@
-(void) viewDidLoad {
self.messagesDelegate = self;
self.title = @"Today";
- if ([[APIClient sharedClient] isAuthenticated]) {
- self.path = [APIClient feedUrl];
- } else {
- self.path = [APIClient messagesUrl];
- self.params = @{@"popular": @1};
- }
+ [self refreshPath];
[self setShouldScrollToBottomOnRefresh:NO];
[super viewDidLoad];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidSignedIn:) name:UserSignedInNotificationName object:nil];
}
-(void)avatarClicked:(NSString *)uname {
@@ -68,4 +65,18 @@
}
+-(void) refreshPath {
+ if ([[APIClient sharedClient] isAuthenticated]) {
+ self.path = [APIClient feedUrl];
+ } else {
+ self.path = [APIClient messagesUrl];
+ self.params = @{@"popular": @1};
+ }
+}
+
+- (void)userDidSignedIn:(User *) user {
+ [self refreshPath];
+ [self refreshData];
+}
+
@end