Use the CORRECT drop function
authorLanius Trolling <lanius@laniustrolling.dev>
Tue, 23 Apr 2024 19:06:53 +0000 (15:06 -0400)
committerLanius Trolling <lanius@laniustrolling.dev>
Tue, 23 Apr 2024 19:06:53 +0000 (15:06 -0400)
src/jvmMain/kotlin/info/mechyrdia/lore/ViewsLore.kt
src/jvmMain/kotlin/info/mechyrdia/robot/RobotSse.kt

index 86aea5e9e46dd95fb75ded996a65078a999175fe..9bed60d3bb964822aa0ed110abb960847dba4f07 100644 (file)
@@ -68,7 +68,7 @@ suspend fun ApplicationCall.loreRawArticlePage(pagePath: List<String>): HTML.()
        val parentPaths = if (pagePath.isEmpty())
                emptyList()
        else {
-               val pathDirs = pagePath.drop(1)
+               val pathDirs = pagePath.dropLast(1)
                listOf(Root.LorePage(emptyList(), LoreArticleFormat.RAW_HTML) to TOC_TITLE) + pathDirs.indices.map { i ->
                        val prefixPath = pathDirs.take(i)
                        Root.LorePage(prefixPath, LoreArticleFormat.RAW_HTML) to (StoragePath.articleDir / prefixPath).toFriendlyPageTitle()
index e22df7acd88503291b7b4d8234da9902e72c77a0..44f2290aed9ccc08fe35a0807ca9bf67dcf8f1e7 100644 (file)
@@ -4,12 +4,6 @@ import io.ktor.client.*
 import io.ktor.client.request.*
 import io.ktor.client.statement.*
 import io.ktor.utils.io.*
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.channels.ProducerScope
-import kotlinx.coroutines.channels.ReceiveChannel
-import kotlinx.coroutines.channels.produce
-import kotlinx.coroutines.currentCoroutineContext
 import kotlinx.coroutines.flow.Flow
 import kotlinx.coroutines.flow.FlowCollector
 import kotlinx.coroutines.flow.flow