Switched to switchToLatest:

This commit is contained in:
Ash Furrow
2013-10-19 17:20:33 -04:00
parent 4de54261f4
commit e5f6253329

View File

@@ -42,16 +42,13 @@
@strongify(self);
return [FRPPhotoImporter logInWithUsername:self.usernameTextField.text password:self.passwordTextField.text];
}];
[self.navigationItem.rightBarButtonItem.rac_command.executionSignals subscribeNext:^(id x) {
[x subscribeNext:^(id x) {
@strongify(self);
if ([x boolValue]) {
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
} else {
[SVProgressHUD showErrorWithStatus:@"Failed"];
}
NSLog(@"Login success: %@", x);
}];
[[self.navigationItem.rightBarButtonItem.rac_command.executionSignals switchToLatest] subscribeNext:^(id x) {
@strongify(self);
if ([x boolValue]) {
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
} else {
[SVProgressHUD showErrorWithStatus:@"Failed"];
}
} error:^(NSError *error) {
NSLog(@"Login error: %@", error);
}];