Skip to content

Commit

Permalink
Merge branch 'develop_1.5' of https://stash.tcsbank.ru/scm/mtip/asdk-ios
Browse files Browse the repository at this point in the history
 into develop_1.5

* 'develop_1.5' of https://stash.tcsbank.ru/scm/mtip/asdk-ios:
  Prevent double cancelling
  Invoke a completion closure on canceled
  • Loading branch information
v.budnikov committed Apr 28, 2020
2 parents bbf026e + 0e7f381 commit 4b81578
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ - (void)viewWillDisappear:(BOOL)animated
if (self.onCancelled)
{
self.onCancelled();
self.onCancelled = nil;
}
}
}
Expand Down Expand Up @@ -528,7 +529,11 @@ - (void)setSelectedCard:(ASDKCard *)selectedCard
- (IBAction)cancelAction:(id)sender
{
[self closeSelfWithCompletion:^{

if (self.onCancelled)
{
self.onCancelled();
self.onCancelled = nil;
}
}];
}

Expand Down Expand Up @@ -1463,7 +1468,13 @@ - (void)cardListDidChanged

- (void)presentationControllerDidDismiss:(UIPresentationController *)presentationController
{
[self closeSelfWithCompletion:self.onCancelled];
[self closeSelfWithCompletion:^{
if (self.onCancelled)
{
self.onCancelled();
self.onCancelled = nil;
}
}];
}

@end

0 comments on commit 4b81578

Please sign in to comment.