Fix JVM error
authorLanius Trolling <lanius@laniustrolling.dev>
Sat, 13 Apr 2024 15:35:25 +0000 (11:35 -0400)
committerLanius Trolling <lanius@laniustrolling.dev>
Sat, 13 Apr 2024 15:35:25 +0000 (11:35 -0400)
src/jvmMain/kotlin/info/mechyrdia/data/ViewsFiles.kt

index 3384d4c965fe4b313db2b0734cf3e0b36cd54c36..6f52079363ae6f404043eea2b6afa1592016f919 100644 (file)
@@ -31,7 +31,7 @@ private val TreeNode.sortIndex: Int
                is TreeNode.DirNode -> 0
        }
 
-private fun Map<String, TreeNode>.sortedAsFiles() = toList()
+private fun Map<String, TreeNode>.sortedAsNodes() = toList()
        .sortedBy { (name, _) -> name }
        .sortedBy { (_, node) -> node.sortIndex }
 
@@ -52,7 +52,7 @@ private suspend fun fileTree(path: StoragePath): TreeNode? {
 
 context(ApplicationCall)
 private fun UL.render(path: StoragePath, childNodes: Map<String, TreeNode>) {
-       val sortedChildren = childNodes.sortedAsFiles()
+       val sortedChildren = childNodes.sortedAsNodes()
        
        for ((name, child) in sortedChildren)
                render(path / name, child)