From 9d78e7d654c51c22ce4be87efef5bc1f8d5a2d08 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 31 Oct 2019 16:16:48 +0300 Subject: Fix authentication --- Juick/ViewControllers/FeedViewController.m | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'Juick/ViewControllers/FeedViewController.m') diff --git a/Juick/ViewControllers/FeedViewController.m b/Juick/ViewControllers/FeedViewController.m index da1b914..c492f2e 100644 --- a/Juick/ViewControllers/FeedViewController.m +++ b/Juick/ViewControllers/FeedViewController.m @@ -10,8 +10,6 @@ #import "ThreadViewController.h" #import "BlogViewController.h" #import "MessageCell.h" -#import "APIClient.h" -#import "AppDelegate.h" #import "LoginViewController.h" NSString * const UserNotAuthenticatedNotificationName = @"UserNotAuthenticated"; @@ -28,7 +26,7 @@ NSString * const UserNotAuthenticatedNotificationName = @"UserNotAuthenticated"; [self refreshPath]; [self setShouldScrollToUnreadOnRefresh:NO]; [super viewDidLoad]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidSignedIn:) name:UserSignedInNotificationName object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidSignedIn:) name:UserChangedNotificationName object:nil]; } -(void)avatarClicked:(NSString *)uname { @@ -46,17 +44,11 @@ NSString * const UserNotAuthenticatedNotificationName = @"UserNotAuthenticated"; } } - - -- (void)didReceiveChallenge { - -} - -(void) refreshPath { - if ([[APIClient sharedClient] isAuthenticated]) { - self.path = [APIClient feedUrl]; + if ([[AppDelegate shared].api currentUser]) { + self.path = [API feedUrl]; } else { - self.path = [APIClient messagesUrl]; + self.path = [API messagesUrl]; self.params = @{@"popular": @1}; } } -- cgit v1.2.3