Skip to content

Commit

Permalink
app: Fix crash when search OS2 version
Browse files Browse the repository at this point in the history
  • Loading branch information
YuKongA committed Oct 30, 2024
1 parent 2d01c2f commit 883d6ac
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composeApp/src/commonMain/kotlin/misc/AppUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ fun handleRomInfo(
val iconNames = changelogGroups.map { it.split("\n").first() }

val iconMainLink = if (isWeb()) "https://updater.yukonga.top/icon/10/" else recoveryRomInfo.fileMirror!!.icon
val iconNameLink = recoveryRomInfo.icon!!
val iconNameLink = recoveryRomInfo.icon ?: mapOf()

val iconLinks = iconLink(iconNames, iconMainLink, iconNameLink)

Expand Down
40 changes: 26 additions & 14 deletions composeApp/src/commonMain/kotlin/ui/components/TextWithIcon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,35 @@ fun TextWithIcon(
modifier = Modifier.padding(bottom = 8.dp),
verticalAlignment = Alignment.CenterVertically
) {
Image(
modifier = Modifier.size(24.dp),
painter = imagePainter,
contentDescription = null,
)
if (iconLink.isNotEmpty()) {
Image(
modifier = Modifier.size(24.dp),
painter = imagePainter,
contentDescription = null,
)
Text(
modifier = Modifier.padding(horizontal = 6.dp),
text = iconName,
fontSize = bodyFontSize,
)
} else {
if (it.isNotEmpty() && it != " ") {
Text(
text = iconName,
fontSize = bodyFontSize,
)
}
}
}
println(it)
if (it.isNotEmpty() && it != " ") {
Text(
modifier = Modifier.padding(horizontal = 6.dp),
text = iconName,
fontSize = bodyFontSize,
text = it,
color = MiuixTheme.colorScheme.onSecondaryVariant,
fontSize = 14.5.sp
)
Spacer(modifier = Modifier.height(padding))
}
Text(
text = it,
color = MiuixTheme.colorScheme.onSecondaryVariant,
fontSize = 14.5.sp
)
Spacer(modifier = Modifier.height(padding))
}
}
}

0 comments on commit 883d6ac

Please sign in to comment.