Skip to content

Commit f2b3ba4

Browse files
committed
[native] fix(Tree): Sorting by link
Signed-off-by: Marcel Klehr <[email protected]>
1 parent 1868c52 commit f2b3ba4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ui/views/native/Tree.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,12 @@ export default {
388388
}
389389
if (this.sortBy !== 'index') {
390390
return sortBy(items, [(item) => {
391-
if (this.sortBy === 'url' && item.url) {
392-
return new URL(item[this.sortBy]).hostname
391+
if (this.sortBy === 'url') {
392+
if (item.url) {
393+
return new URL(item.url).hostname
394+
} else {
395+
return '0' // folders to the top
396+
}
393397
}
394398
return item[this.sortBy].toLowerCase()
395399
}])

0 commit comments

Comments
 (0)