summaryrefslogtreecommitdiff
path: root/Juick/AppDelegate.m
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/AppDelegate.m')
-rw-r--r--Juick/AppDelegate.m14
1 files changed, 12 insertions, 2 deletions
diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m
index 779de12..7c90018 100644
--- a/Juick/AppDelegate.m
+++ b/Juick/AppDelegate.m
@@ -57,8 +57,18 @@
split.delegate = messages;
self.viewController = split;
}
- [messages loadFromPath:[Message messagesUrl] withParams:nil withTitle:@"Discover"];
-
+ if ([User isAuthenticated]) {
+ [User checkIsValid:^(BOOL success) {
+ if (success) {
+ [messages loadFromPath:[Message feedUrl] withParams:nil withTitle:@"My feed"];
+ } else {
+ [User throwUnableToLogin];
+ }
+ }];
+
+ } else {
+ [messages loadFromPath:[Message messagesUrl] withParams:nil withTitle:@"Discover"];
+ }
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];