mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-18 15:59:22 +00:00
Locking a db now requests a password/key if none is set
This commit is contained in:
@@ -343,8 +343,13 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
|
||||
- (IBAction)lock:(id)sender {
|
||||
MPDocument *document = [self document];
|
||||
if(!document.compositeKey.hasPasswordOrKeyFile) {
|
||||
return; // Document needs a password/keyfile to be lockable
|
||||
if(!document.compositeKey) {
|
||||
[self editPasswordWithCompetionHandler:^(NSInteger result) {
|
||||
if(result == NSModalResponseOK) {
|
||||
[self lock:sender];
|
||||
}
|
||||
}];
|
||||
return;
|
||||
}
|
||||
if(document.encrypted) {
|
||||
return; // Document already locked
|
||||
|
||||
Reference in New Issue
Block a user