mirror of
https://github.com/zoriya/flood.git
synced 2025-12-20 06:05:15 +00:00
Sort files at end of directory tree
This commit is contained in:
@@ -19,7 +19,19 @@ export default class DirectoryTree extends React.Component {
|
||||
let hash = this.props.hash;
|
||||
depth++;
|
||||
|
||||
return Object.keys(tree).map((branchName) => {
|
||||
let directories = Object.keys(tree).sort((a, b) => {
|
||||
if (a === 'files') {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (b === 'files') {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return a.localeCompare(b);
|
||||
});
|
||||
|
||||
return directories.map((branchName) => {
|
||||
let branch = tree[branchName];
|
||||
index++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user