mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Merge pull request #2262 from keepassxreboot/fix/credential_sorting
Fix credential sorting
This commit is contained in:
commit
49e8e1a354
1 changed files with 5 additions and 5 deletions
|
|
@ -405,7 +405,7 @@ kpxc.initLoginPopup = function() {
|
|||
|
||||
return {
|
||||
title: title,
|
||||
group: credential.group,
|
||||
group: credential.group || '',
|
||||
visibleLogin: visibleLogin,
|
||||
login: credential.login,
|
||||
loginId: loginId,
|
||||
|
|
@ -416,10 +416,10 @@ kpxc.initLoginPopup = function() {
|
|||
|
||||
// Sorting with or without group name included
|
||||
const sortLoginItemBy = function(a, b, name, withGroup = false) {
|
||||
const firstGroup = a.group.toLowerCase();
|
||||
const secondGroup = b.group.toLowerCase();
|
||||
const first = a[name].toLowerCase();
|
||||
const second = b[name].toLowerCase();
|
||||
const firstGroup = a.group?.toLowerCase();
|
||||
const secondGroup = b.group?.toLowerCase();
|
||||
const first = a[name]?.toLowerCase();
|
||||
const second = b[name]?.toLowerCase();
|
||||
|
||||
return withGroup
|
||||
? firstGroup.localeCompare(secondGroup) || first.localeCompare(second)
|
||||
|
|
|
|||
Loading…
Reference in a new issue