Fixes a bug resutling in a reappering password change promt when the database is already lock (fixes #696)

This commit is contained in:
michael starke
2017-11-23 08:19:55 +01:00
parent 278a0145d0
commit 2495eac177

View File

@@ -342,7 +342,10 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
}
- (IBAction)lock:(id)sender {
MPDocument *document = [self document];
MPDocument *document = self.document;
if(document.encrypted) {
return; // Document already locked
}
if(!document.compositeKey) {
[self editPasswordWithCompetionHandler:^(NSInteger result) {
if(result == NSModalResponseOK) {
@@ -351,9 +354,6 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
}];
return;
}
if(document.encrypted) {
return; // Document already locked
}
[document lockDatabase:sender];
}