diff options
author | Vitaly Takmazov | 2019-03-22 00:56:41 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-03-22 00:56:41 +0300 |
commit | 78412d188e8cf119046ee8b2344a07674ccf7f43 (patch) | |
tree | b97287947b07bc63a05fb4a8607ccc4bf19aa747 /Juick/ViewControllers/FeedViewController.m | |
parent | 5f4a09ec689cb04ce71b4eb7425936f04a70f6f4 (diff) |
Fix today feed
Diffstat (limited to 'Juick/ViewControllers/FeedViewController.m')
-rw-r--r-- | Juick/ViewControllers/FeedViewController.m | 23 |
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 |