Merge pull request #3265 from SillyTavern/fix-bogus-sorting Folders should not be sorted in the char list

6029b51f7efdb1bf01c4ee870aa2706330814a05

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +4 -6Ignore whitespace
public/scripts/power-user.js+4 -6
@@ -2094,12 +2094,10 @@ export function sortEntitiesList(entities, forceSearch, filterHelper = null) {
2094 }2094 }
20952095
2096 entities.sort((a, b) => {2096 entities.sort((a, b) => {
2097 // Sort tags/folders will always be at the top2097 // Sort tags/folders will always be at the top. Their original sorting will be kept, to respect manual tag sorting.
2098 if (a.type === 'tag' && b.type !== 'tag') {2098 if (a.type === 'tag' || b.type === 'tag') {
2099 return -1;2099 // The one that is a tag will be at the top
2100 }2100 return (a.type === 'tag' ? -1 : 1) - (b.type === 'tag' ? -1 : 1);
2101 if (a.type !== 'tag' && b.type === 'tag') {
2102 return 1;
2103 }2101 }
21042102
2105 // If we have search sorting, we take scores and use those2103 // If we have search sorting, we take scores and use those