From 26f8e086bb9f4998c8635145ca4d56dc1a5591fe Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Thu, 3 May 2012 20:17:30 +0200 Subject: [PATCH] Fix double reset counter trigger. [FIXED] Reset password counter triggered twice. --- External/Pearl | 2 +- MasterPassword/iOS/MPMainViewController.m | 6 +++++- MasterPassword/iOS/MainStoryboard_iPhone.storyboard | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/External/Pearl b/External/Pearl index 32660d8e..5736ed0c 160000 --- a/External/Pearl +++ b/External/Pearl @@ -1 +1 @@ -Subproject commit 32660d8ebc2701bf8f702c64c1bdc1b9382b1612 +Subproject commit 5736ed0cb528aeabbad5cec1ae133c9002be2983 diff --git a/MasterPassword/iOS/MPMainViewController.m b/MasterPassword/iOS/MPMainViewController.m index 5e341383..d47880c5 100644 --- a/MasterPassword/iOS/MPMainViewController.m +++ b/MasterPassword/iOS/MPMainViewController.m @@ -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; diff --git a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard index e2c4c185..4b7ed447 100644 --- a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard +++ b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard @@ -599,7 +599,6 @@ L4m3P4sSw0rD -