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 -6Showing whitespace changes
public/scripts/power-user.js+4 -6
@@ -2094,12 +2094,10 @@ export function sortEntitiesList(entities, forceSearch, filterHelper = null) {
20942094 }
20952095
20962096 entities.sort((a, b) => {
20972097 // Sort tags/folders will always be at the top. Their original sorting will be kept, to respect manual tag sorting.
20982098 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;
21032101 }
21042102
21052103 // If we have search sorting, we take scores and use those