mirror of
https://github.com/syncthing/syncthing.git
synced 2024-11-16 10:28:49 -07: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) {
|
||||
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 a.id > b.id;
|
||||
return labelA > labelB;
|
||||
}
|
||||
|
||||
function folderMap(l) {
|
||||
|
Loading…
Reference in New Issue
Block a user