Skip to content

Commit 9a70023

Browse files
committed
Dropbox file selector should list folders first
1 parent e49de77 commit 9a70023

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/dropbox-file-selector/dropbox-file-selector.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ export default {
277277
// populate leaf with fetched children
278278
leaf.children = ( entries?.map( entry => mapEntry( entry, [], parent )) ?? [] )
279279
.sort(( a, b ) => {
280+
if ( a.type === "folder" ) {
281+
return -1;
282+
} else if ( b.type === "folder" ) {
283+
return 1;
284+
}
280285
if ( a.type < b.type ) {
281286
return 1;
282287
} else if ( a.type > b.type ) {

0 commit comments

Comments
 (0)