@@ -81,7 +81,7 @@ - (void)scannedAddress:(NSString *)address amount:(NSString *)amount {
8181 UIBAlertView* av = [[UIBAlertView alloc ] initWithTitle: l10n (@" error" ) message: l10n (@" not_a_key" ) cancelButtonTitle: l10n (@" cancel" ) otherButtonTitles: l10n (@" retry" ), nil ];
8282 [av showWithDismissHandler: ^(NSInteger selectedIndex, NSString *selectedTitle, BOOL didCancel) {
8383 if (didCancel) {
84- [self .navigationController popViewControllerAnimated: YES ];
84+ [self close: self ];
8585 } else {
8686 [self startScan ];
8787 }
@@ -101,22 +101,22 @@ - (void)checkBalance:(BTCKey *)key {
101101 UIBAlertView* av = [[UIBAlertView alloc ] initWithTitle: l10n (@" swipe_key_title" ) message: [NSString stringWithFormat: l10n (@" swipe_key_message" ), (double )balance / 100000000 ] cancelButtonTitle: l10n (@" cancel" ) otherButtonTitles: l10n (@" yes" ), nil ];
102102 [av showWithDismissHandler: ^(NSInteger selectedIndex, NSString *selectedTitle, BOOL didCancel) {
103103 if (didCancel) {
104- [self .navigationController popViewControllerAnimated: YES ];
104+ [self close: self ];
105105 } else {
106106 [self doTransaction: key];
107107 }
108108 }];
109109 } else {
110110 UIBAlertView* av = [[UIBAlertView alloc ] initWithTitle: l10n (@" error" ) message: l10n (@" not_enough_funds" ) cancelButtonTitle: l10n (@" okay" ) otherButtonTitles: nil ];
111111 [av showWithDismissHandler: ^(NSInteger selectedIndex, NSString *selectedTitle, BOOL didCancel) {
112- [self .navigationController popViewControllerAnimated: YES ];
112+ [self close: self ];
113113 }];
114114 }
115115 } else {
116116 UIBAlertView* av = [[UIBAlertView alloc ] initWithTitle: l10n (@" error" ) message: l10n (@" could_not_fetch_balance" ) cancelButtonTitle: l10n (@" cancel" ) otherButtonTitles: l10n (@" retry" ), nil ];
117117 [av showWithDismissHandler: ^(NSInteger selectedIndex, NSString *selectedTitle, BOOL didCancel) {
118118 if (didCancel) {
119- [self .navigationController popViewControllerAnimated: YES ];
119+ [self close: self ];
120120 } else {
121121 [self checkBalance: key];
122122 }
@@ -147,12 +147,12 @@ - (void)doTransaction:(BTCKey *)key {
147147
148148 UIBAlertView* av = [[UIBAlertView alloc ] initWithTitle: l10n (@" success" ) message: l10n (@" swipe_success" ) cancelButtonTitle: l10n (@" okay" ) otherButtonTitles: nil ];
149149 [av showWithDismissHandler: ^(NSInteger selectedIndex, NSString *selectedTitle, BOOL didCancel) {
150- [self .navigationController popViewControllerAnimated: YES ];
150+ [self close: self ];
151151 }];
152152 } else {
153153 UIBAlertView* av = [[UIBAlertView alloc ] initWithTitle: l10n (@" error" ) message: l10n (@" swipe_failed" ) cancelButtonTitle: l10n (@" okay" ) otherButtonTitles: nil ];
154154 [av showWithDismissHandler: ^(NSInteger selectedIndex, NSString *selectedTitle, BOOL didCancel) {
155- [self .navigationController popViewControllerAnimated: YES ];
155+ [self close: self ];
156156 }];
157157 }
158158}
0 commit comments