Skip to content

Commit ea5a08e

Browse files
committed
Removed activity indicator & only show alert if correct amount received
1 parent 3095743 commit ea5a08e

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

BitStore/Controller/Account/Receive/ReceiveViewController.m

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,6 @@ - (void)viewDidLoad {
9696
[_amountLabel addGestureRecognizer:tap];
9797
_amountLabel.userInteractionEnabled = YES;
9898
[self.view addSubview:_amountLabel];
99-
100-
101-
UIActivityIndicatorView* indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
102-
indicator.frame = CGRectMake(self.view.frame.size.width / 2 - 16, self.view.frame.size.height - 125, 32, 32);
103-
[indicator startAnimating];
104-
[self.view addSubview:indicator];
10599
}
106100

107101
- (void)actionAdd:(id)sender {
@@ -117,14 +111,15 @@ - (void)addressChanged:(Address *)address {
117111
NSString* amount = [_exchange.unit valueForSatoshi:(_address.total - _lastBalance)];
118112

119113
if (!_secStop) {
120-
UIBAlertView* successAlert = [[UIBAlertView alloc] initWithTitle:l10n(@"success") message:[NSString stringWithFormat:l10n(@"push_message"), amount] cancelButtonTitle:l10n(@"okay") otherButtonTitles:nil];
121-
[successAlert showWithDismissHandler:^(NSInteger selectedIndex, NSString *selectedTitle, BOOL didCancel) {
122-
[self close:self];
123-
}];
124-
_secStop = YES;
114+
if (_satoshi == 0 || _satoshi == (_address.total - _lastBalance)) {
115+
UIBAlertView* successAlert = [[UIBAlertView alloc] initWithTitle:l10n(@"success") message:[NSString stringWithFormat:l10n(@"push_message"), amount] cancelButtonTitle:l10n(@"okay") otherButtonTitles:nil];
116+
[successAlert showWithDismissHandler:^(NSInteger selectedIndex, NSString *selectedTitle, BOOL didCancel) {
117+
[self close:self];
118+
}];
119+
_secStop = YES;
120+
}
125121
} else {
126122
[_address stopUpdate];
127-
NSLog(@"trying to stop again");
128123
}
129124
}
130125
}

0 commit comments

Comments
 (0)