mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #1154 from keepassxreboot/fix/autocomplete_max_name_length
Trim entry name in Autocomplete Menu when needed
This commit is contained in:
commit
7f628f53db
2 changed files with 6 additions and 1 deletions
|
|
@ -1,5 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
const MAX_AUTOCOMPLETE_NAME_LEN = 50;
|
||||
|
||||
const kpxcAutocomplete = {};
|
||||
kpxcAutocomplete.autoSubmit = false;
|
||||
kpxcAutocomplete.elements = [];
|
||||
|
|
|
|||
|
|
@ -1140,9 +1140,12 @@ kpxc.initLoginPopup = function() {
|
|||
}
|
||||
|
||||
const getLoginText = function(credential, withGroup) {
|
||||
const name = credential.name.length < MAX_AUTOCOMPLETE_NAME_LEN
|
||||
? credential.name
|
||||
: credential.name.substr(0, MAX_AUTOCOMPLETE_NAME_LEN) + '…';
|
||||
const group = (withGroup && credential.group) ? `[${credential.group}] ` : '';
|
||||
const visibleLogin = (credential.login.length > 0) ? credential.login : tr('credentialsNoUsername');
|
||||
const text = `${group}${credential.name} (${visibleLogin})`;
|
||||
const text = `${group}${name} (${visibleLogin})`;
|
||||
|
||||
if (credential.expired && credential.expired === 'true') {
|
||||
return `${text} [${tr('credentialExpired')}]`;
|
||||
|
|
|
|||
Loading…
Reference in a new issue