From 3724b46680bb3daded43423cb6f66bdc08793f20 Mon Sep 17 00:00:00 2001 From: sanlorng Date: Fri, 17 May 2024 09:46:13 +0800 Subject: [PATCH] [gallery] fixed `generateScreen`. --- .../fluent/gallery/processor/ComponentProcessor.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gallery-processor/src/jvmMain/kotlin/com/konyaco/fluent/gallery/processor/ComponentProcessor.kt b/gallery-processor/src/jvmMain/kotlin/com/konyaco/fluent/gallery/processor/ComponentProcessor.kt index 16093db1..f716b2b7 100644 --- a/gallery-processor/src/jvmMain/kotlin/com/konyaco/fluent/gallery/processor/ComponentProcessor.kt +++ b/gallery-processor/src/jvmMain/kotlin/com/konyaco/fluent/gallery/processor/ComponentProcessor.kt @@ -353,9 +353,11 @@ class ComponentProcessor(private val logger: KSPLogger, private val codeGenerato annotation.arguments.forEach { when (it.name?.asString()) { "icon" -> icon = (it.value as? String)?.ifBlank { null } - "generateScreen" -> contentData = """ - { ComponentIndexScreen(it) } - """.trimIndent() + "generateScreen" -> if (it.value as? Boolean == true) { + contentData = """ + { ComponentIndexScreen(it) } + """.trimIndent() + } } } }