2
0

Fix double reset counter trigger.

[FIXED]     Reset password counter triggered twice.
This commit is contained in:
Maarten Billemont 2012-05-03 20:17:30 +02:00
parent 950ce888e2
commit 26f8e086bb
3 changed files with 6 additions and 3 deletions

2
External/Pearl vendored

@ -1 +1 @@
Subproject commit 32660d8ebc2701bf8f702c64c1bdc1b9382b1612
Subproject commit 5736ed0cb528aeabbad5cec1ae133c9002be2983

View File

@ -111,6 +111,7 @@
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationWillResignActiveNotification object:nil queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification *note) {
self.activeElement = nil;
[self updateWasAnimated:NO];
}];
self.alertBody.text = nil;
@ -296,7 +297,7 @@
[self changeElementWithWarning:
@"You are incrementing the site's password counter.\n\n"
@"If you continue, a new password will be generated for this site. "
@"You will then need to update your account's old password to this newly generated password.\n"
@"You will then need to update your account's old password to this newly generated password.\n\n"
@"You can reset the counter by holding down on this button."
do:^{
++((MPElementGeneratedEntity *) self.activeElement).counter;
@ -307,6 +308,9 @@
- (IBAction)resetPasswordCounter:(UILongPressGestureRecognizer *)sender {
if (sender.state != UIGestureRecognizerStateBegan)
// Only fire when the gesture was first detected.
return;
if (![self.activeElement isKindOfClass:[MPElementGeneratedEntity class]])
// Not of a type that supports a password counter.
return;

View File

@ -599,7 +599,6 @@ L4m3P4sSw0rD</string>
<pongPressGestureRecognizer allowableMovement="10" minimumPressDuration="0.5" id="cZr-Fj-eBw">
<connections>
<action selector="resetPasswordCounter:" destination="PQa-Xl-A3x" id="JL9-Ob-AjQ"/>
<outlet property="delegate" destination="PQa-Xl-A3x" id="PMQ-so-Cj7"/>
</connections>
</pongPressGestureRecognizer>
</objects>