Skip to content

Commit

Permalink
[Refact] 뉴스 카드 코드 간소화
Browse files Browse the repository at this point in the history
  • Loading branch information
YiBeomSeok committed Apr 3, 2024
1 parent bf7119e commit 894035c
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,15 @@ internal fun NewsCard(
onClick: () -> Unit,
) {
var imageUrl by remember { mutableStateOf(newsModel.imageUrl) }
LaunchedEffect(true) {
if (imageUrl == null) {
withContext(Dispatchers.IO) {
val document = Jsoup.connect(newsModel.link).get()
imageUrl = document.select("meta[property=og:image]").attr("content")
}
LaunchedEffect(imageUrl == null) {
withContext(Dispatchers.IO) {
val document = Jsoup.connect(newsModel.link).get()
imageUrl = document.select("meta[property=og:image]").attr("content")
}
}
LifeMashCard(modifier = Modifier.clickable { onClick() }) {
Column(
modifier = Modifier
.fillMaxWidth(),
modifier = Modifier.fillMaxWidth(),
) {
NetworkImage(
modifier = Modifier.fillMaxWidth().aspectRatio(2f),
Expand Down

0 comments on commit 894035c

Please sign in to comment.