Folders should not be sorted in the char list

- Folders respect the chosen sorting of the "Tag Management"
- They will still always be displayed on top
- They will now not follow any chosen list sorting, so do not get changed based on alphabetical sorting of the char list
This commit is contained in:
Wolfsblvt 2025-01-05 20:27:20 +01:00
parent 989f5a8692
commit 9264008766

View File

@ -2094,12 +2094,10 @@ export function sortEntitiesList(entities, forceSearch, filterHelper = null) {
} }
entities.sort((a, b) => { entities.sort((a, b) => {
// Sort tags/folders will always be at the top // Sort tags/folders will always be at the top. Their original sorting will be kept, to respect manual tag sorting.
if (a.type === 'tag' && b.type !== 'tag') { if (a.type === 'tag' || b.type === 'tag') {
return -1; // The one that is a tag will be at the top
} return (a.type === 'tag' ? -1 : 1) - (b.type === 'tag' ? -1 : 1);
if (a.type !== 'tag' && b.type === 'tag') {
return 1;
} }
// If we have search sorting, we take scores and use those // If we have search sorting, we take scores and use those