-
-
Notifications
You must be signed in to change notification settings - Fork 437
Add check for duplicates upon saving entry #1652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add check for duplicates upon saving entry #1652
Conversation
2f66a12
to
d86dbe7
Compare
addAndFinish(entry); | ||
return true; | ||
} | ||
|
||
private void showDuplicateBottomSheet(VaultEntry newEntry) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style nit: The {
belongs on the same line.
newEntry.getName() | ||
); | ||
|
||
new AlertDialog.Builder(this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a MaterialAlertDialogBuilder
.
newName = baseName + " #" + counter++; | ||
} while (existingNames.contains(newName)); | ||
|
||
if (suffixSubtext != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this ever be null?
app/src/main/res/values/strings.xml
Outdated
@@ -373,6 +373,21 @@ | |||
<string name="note" comment="Users can add a note to an entry">Note</string> | |||
<string name="clear">Clear</string> | |||
|
|||
<string name="dialog_duplicate_entry_title">Duplicate Entry</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want "Entry" in upper or lower case? I think we usually do lower case throughout the app.
app/src/main/res/values/strings.xml
Outdated
<item quantity="other">Are you sure you want to delete %d entries with the following name:\n\n%s - %s</item> | ||
</plurals> | ||
|
||
<string name="dialog_duplicate_entry_overwrite_dialog_title">Confirm Deletion</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same casing question here.
d86dbe7
to
1335be6
Compare
This PR adds a new BottomSheetDialog in the EditEntryActivity notifying the user that a similar entry (based on name + issuer) already exists. We will prompt the user with a couple options on how to proceed. I purposely left out the "Save anyway" option because I don't see the need for it, but let me know if you'd like to see otherwise.
Closes #1606