File tree 2 files changed +15
-3
lines changed
programs/FileBrowser/MainContent
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,20 @@ function MainContent({
39
39
setContextMenuOpen ( true ) ;
40
40
}
41
41
42
+ function getFSObjects ( ) {
43
+ const objects = Object . values < FSObject > ( currentDirectory . contents ) . sort (
44
+ ( a , b ) => {
45
+ const nameA = a . name . toLowerCase ( ) ;
46
+ const nameB = b . name . toLowerCase ( ) ;
47
+ if ( nameA < nameB ) return - 1 ;
48
+ if ( nameA > nameB ) return 1 ;
49
+ return 0 ;
50
+ }
51
+ ) ;
52
+
53
+ return objects ;
54
+ }
55
+
42
56
return (
43
57
< StyledMainContent onContextMenu = { handleRightClick } >
44
58
{ contextMenuOpen && (
@@ -56,7 +70,7 @@ function MainContent({
56
70
close = { ( ) => setPromptFor ( null ) }
57
71
/>
58
72
) }
59
- { Object . values < FSObject > ( currentDirectory . contents ) . map ( ( fsObject ) => (
73
+ { getFSObjects ( ) . map ( ( fsObject ) => (
60
74
< DirectoryOrFile
61
75
fsObject = { fsObject }
62
76
openFSObject = { openFSObject }
Original file line number Diff line number Diff line change @@ -295,10 +295,8 @@ export const useLocalFS = create<LocalFSState>()(
295
295
// store the path on each FSObject and instead store a reference to
296
296
// the parent FSDirectory, but this would very tricky to persist
297
297
function updatePathRecursive ( fsObject : FSObject ) {
298
- console . log ( "Updating" , fsObject . path ) ;
299
298
const regex = new RegExp ( `^${ oldPath } ` ) ;
300
299
fsObject . path = fsObject . path . replace ( regex , newPath ) ;
301
- console . log ( "Updated to" , fsObject . path ) ;
302
300
303
301
if ( ! isFSDirectory ( fsObject ) ) return ;
304
302
You can’t perform that action at this time.
0 commit comments