mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-02-01 13:22:04 -08:00
Fix sorting bugs.
This commit is contained in:
parent
4fa6f7cf52
commit
4279f7c6bb
2 changed files with 128 additions and 123 deletions
|
|
@ -494,18 +494,15 @@ class ExtraNetworksClusterizeCardsList extends ExtraNetworksClusterize {
|
|||
});
|
||||
}
|
||||
|
||||
sortByName(data) {
|
||||
sortByPath(data) {
|
||||
return Object.keys(data).sort((a, b) => {
|
||||
return STR_COLLATOR.compare(data[a].sort_name, data[b].sort_name);
|
||||
return INT_COLLATOR.compare(data[a].sort_path, data[b].sort_path);
|
||||
});
|
||||
}
|
||||
|
||||
sortByPath(data) {
|
||||
sortByName(data) {
|
||||
return Object.keys(data).sort((a, b) => {
|
||||
// Wrap the paths in File objects to allow for proper sorting of filepaths.
|
||||
const a_file = new File([""], data[a].sort_path);
|
||||
const b_file = new File([""], data[b].sort_path);
|
||||
return a_file - b_file;
|
||||
return INT_COLLATOR.compare(data[a].sort_name, data[b].sort_name);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue