summaryrefslogtreecommitdiff
path: root/Juick/ViewControllers
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2021-12-01 17:43:49 +0300
committerGravatar Vitaly Takmazov2021-12-01 17:43:49 +0300
commit2c046a01003665aa78ca8f069c215ba1420c76cc (patch)
tree35bcf521084e3ed242bc841fb1920f4dcf629882 /Juick/ViewControllers
parentaa02a7e5ee527e20812096a6ae6294adec405877 (diff)
Present login error correctly on iPad/Mac
Diffstat (limited to 'Juick/ViewControllers')
-rw-r--r--Juick/ViewControllers/LoginViewController.m5
-rw-r--r--Juick/ViewControllers/MessagesViewController.m2
-rw-r--r--Juick/ViewControllers/NewPostViewController.m4
3 files changed, 8 insertions, 3 deletions
diff --git a/Juick/ViewControllers/LoginViewController.m b/Juick/ViewControllers/LoginViewController.m
index a0e9b97..dd80215 100644
--- a/Juick/ViewControllers/LoginViewController.m
+++ b/Juick/ViewControllers/LoginViewController.m
@@ -8,6 +8,7 @@
#import "LoginViewController.h"
#import "User.h"
+#import "User+UIView.h"
NSString * const UserChangedNotificationName = @"UserSignedIn";
@@ -57,6 +58,10 @@ NSString * const UserChangedNotificationName = @"UserSignedIn";
[[NSNotificationCenter defaultCenter] postNotificationName:UserChangedNotificationName object:nil];
[[AppDelegate shared] registerForRemoteNotifications];
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
+ } else {
+ [[NSOperationQueue mainQueue] addOperationWithBlock:^{
+ [User throwUnableToLogin:self sourceView:self.passwordField error:[NSError errorWithDomain:JuickErrorDomain code:403 userInfo:@{}] path:@"/login" params:nil];
+ }];
}
}];
}
diff --git a/Juick/ViewControllers/MessagesViewController.m b/Juick/ViewControllers/MessagesViewController.m
index cd4d740..0fb04ac 100644
--- a/Juick/ViewControllers/MessagesViewController.m
+++ b/Juick/ViewControllers/MessagesViewController.m
@@ -49,7 +49,7 @@ NSString* const messageCellIdentifier = @"messageCell";
}
self.dataLoading = NO;
if (err) {
- [User throwUnableToLogin:self error:err path:self.path params:self.params];
+ [User throwUnableToLogin:self sourceView:self.navigationItem.titleView error:err path:self.path params:self.params];
return;
}
NSArray *newMsgs = next;
diff --git a/Juick/ViewControllers/NewPostViewController.m b/Juick/ViewControllers/NewPostViewController.m
index 1b655f6..760dd84 100644
--- a/Juick/ViewControllers/NewPostViewController.m
+++ b/Juick/ViewControllers/NewPostViewController.m
@@ -57,7 +57,7 @@ NSString * const ReplyPostedNotificationName = @"ReplyPosted";
}];
} else {
self.navigationController.navigationItem.rightBarButtonItem.enabled = YES;
- [User throwUnableToLogin:self error:err path:@"postMessage" params:nil];
+ [User throwUnableToLogin:self sourceView:self.navigationItem.rightBarButtonItem error:err path:@"postMessage" params:nil];
}
}];
} else {
@@ -69,7 +69,7 @@ NSString * const ReplyPostedNotificationName = @"ReplyPosted";
}];
} else {
self.navigationItem.rightBarButtonItem.enabled = YES;
- [User throwUnableToLogin:self error:err path:@"postreply" params:nil];
+ [User throwUnableToLogin:self sourceView:self.navigationItem.rightBarButtonItem error:err path:@"postreply" params:nil];
}
}];
}