Show a helpful dialog on bad username / password (the old dialog didn't work because showAsAlert tries to show it in the tab controller which isn't visible, plus it only said 'M_FORBIDDEN' anyway).

This commit is contained in:
David Baker
2014-11-09 10:42:40 +00:00
parent 218cf0a645
commit 21c8ed6ea3

View File

@@ -18,6 +18,7 @@
#import "MatrixHandler.h"
#import "AppDelegate.h"
#import "CustomAlert.h"
NSString* const defaultHomeserver = @"http://matrix.org";
@@ -212,7 +213,9 @@ NSString* const defaultHomeserver = @"http://matrix.org";
NSLog(@"Login failed: %@", error);
//Alert user
[[AppDelegate theDelegate] showErrorAsAlert:error];
CustomAlert *alert = [[CustomAlert alloc] initWithTitle:@"Login Failed" message:@"Invalid username/password" style:CustomAlertStyleAlert];
[alert addActionWithTitle:@"Dismiss" style:CustomAlertActionStyleCancel handler:^(CustomAlert *alert) {}];
[alert showInViewController:self];
}];
}
} else if (sender == _createAccountBtn){