From 7ef88b7e88de3a25009bfd9db837d3e80a8012f1 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Wed, 10 Feb 2021 15:47:13 +0100 Subject: [PATCH] Fixed duplicated entry not being selected in in entry table view. --- MacPass/MPDocument.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index ac3d47da..4b27c35c 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -852,12 +852,19 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGrou } - (void)duplicateEntryWithOptions:(KPKCopyOptions)options { + KPKEntry *duplicate; for(KPKEntry *entry in self.selectedEntries) { - KPKEntry *duplicate = [entry copyWithTitle:nil options:options]; + duplicate = [entry copyWithTitle:nil options:options]; [duplicate addToGroup:entry.parent]; } [self.undoManager setActionName:[NSString stringWithFormat:NSLocalizedString(@"DUPLICATE_ENTRIES_ACTION_NAME", @"Action name for duplicating entries"), self.selectedEntries.count]]; + if(duplicate) { + [NSNotificationCenter.defaultCenter postNotificationName:MPDocumentDidAddEntryNotification + object:self + userInfo:@{ MPDocumentEntryKey: duplicate }]; + } } + - (void)duplicateGroup:(id)sender { for(KPKGroup *group in self.selectedGroups) {