mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-16 06:28:27 +02:00
Disable button on login to prevent multiple requests
This commit is contained in:
@@ -66,7 +66,6 @@ NSString* const defaultHomeserver = @"http://matrix.org";
|
||||
constant:0];
|
||||
[self.view addConstraint:rightConstraint];
|
||||
|
||||
|
||||
// Prefill text field
|
||||
_userLoginTextField.text = [[MatrixHandler sharedHandler] userLogin];
|
||||
_homeServerTextField.text = [[MatrixHandler sharedHandler] homeServerURL];
|
||||
@@ -192,6 +191,8 @@ NSString* const defaultHomeserver = @"http://matrix.org";
|
||||
|
||||
if (matrix.mxHomeServer)
|
||||
{
|
||||
// Disable login button to prevent multiple requests
|
||||
_loginBtn.enabled = NO;
|
||||
[_activityIndicator startAnimating];
|
||||
|
||||
[matrix.mxHomeServer loginWithUser:matrix.userLogin andPassword:_passWordTextField.text
|
||||
@@ -207,6 +208,7 @@ NSString* const defaultHomeserver = @"http://matrix.org";
|
||||
}
|
||||
failure:^(NSError *error){
|
||||
[_activityIndicator stopAnimating];
|
||||
_loginBtn.enabled = YES;
|
||||
|
||||
NSLog(@"Login failed: %@", error);
|
||||
//Alert user
|
||||
|
||||
Reference in New Issue
Block a user