local sort bring folders to the front

pull/548/head
微凉 2022-01-09 19:28:48 +08:00
parent 7ef98c05fa
commit db58dabd31
1 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,14 @@ func SortFiles(files []File, account *Account) {
return
}
sort.Slice(files, func(i, j int) bool {
if files[i].IsDir() || files[j].IsDir() {
if !files[i].IsDir() {
return false
}
if !files[j].IsDir() {
return true
}
}
switch account.OrderBy {
case "name":
{