Skip to content

Commit

Permalink
Merge pull request #1357 from stripe/yuki-fix-cardio-crash
Browse files Browse the repository at this point in the history
Hide 'scan card' button while STPAddCardViewController is loading
  • Loading branch information
yuki-stripe authored Sep 9, 2019
2 parents d793441 + 3fac18e commit 3050cf2
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Stripe/STPAddCardViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,6 @@ - (void)presentCardIO {
[self.cardIOProxy presentCardIOFromViewController:self];
}

- (void)cardIOProxy:(__unused STPCardIOProxy *)proxy didFinishWithCardParams:(STPPaymentMethodCardParams *)cardParams {
if (cardParams) {
self.paymentCell.paymentField.cardParams = cardParams;
}
}

- (void)endEditing {
[self.view endEditing:NO];
}
Expand Down Expand Up @@ -242,8 +236,10 @@ - (void)setLoading:(BOOL)loading {
[self.tableView endEditing:YES];
UIBarButtonItem *loadingItem = [[UIBarButtonItem alloc] initWithCustomView:self.activityIndicator];
[self.stp_navigationItemProxy setRightBarButtonItem:loadingItem animated:YES];
self.cardHeaderView.buttonHidden = YES;
} else {
[self.stp_navigationItemProxy setRightBarButtonItem:self.doneItem animated:YES];
self.cardHeaderView.buttonHidden = NO;
}
NSArray *cells = self.addressViewModel.addressCells;
for (UITableViewCell *cell in [cells arrayByAddingObject:self.paymentCell]) {
Expand Down Expand Up @@ -518,4 +514,13 @@ - (void)useShippingAddress:(__unused UIButton *)sender {
[self.tableView endUpdates];
}

#pragma mark - STPCardIOProxyDelegate

- (void)cardIOProxy:(__unused STPCardIOProxy *)proxy didFinishWithCardParams:(STPPaymentMethodCardParams *)cardParams {
if (cardParams) {
self.paymentCell.paymentField.cardParams = cardParams;
}
}


@end

0 comments on commit 3050cf2

Please sign in to comment.