mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-24 15:38:27 +00:00
gui: Sort folders by label, fall back to ids if required (fixes #3310)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3326
This commit is contained in:
parent
20a94fafa7
commit
89a29946f9
@ -49,10 +49,20 @@ function deviceCompare(a, b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function folderCompare(a, b) {
|
function folderCompare(a, b) {
|
||||||
if (a.id < b.id) {
|
var labelA = a.id;
|
||||||
|
if (typeof a.label !== 'undefined' && a.label !== null && a.label.length > 0) {
|
||||||
|
labelA = a.label;
|
||||||
|
}
|
||||||
|
|
||||||
|
var labelB = b.id;
|
||||||
|
if (typeof b.label !== 'undefined' && b.label !== null && b.label.length > 0) {
|
||||||
|
labelB = b.label;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (labelA < labelB) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return a.id > b.id;
|
return labelA > labelB;
|
||||||
}
|
}
|
||||||
|
|
||||||
function folderMap(l) {
|
function folderMap(l) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user