Skip to content

Commit cb15888

Browse files
fix: empty tags shouldn't be shown
1 parent f2c4a33 commit cb15888

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

android/src/main/kotlin/project/pipepipe/app/ui/screens/videodetail/DescriptionSection.kt

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ fun DescriptionSection(
5858
onClick = {
5959
SharedContext.showImageViewer(listOf(thumbnailUrl), 0)
6060
},
61-
modifier = Modifier.scale(0.8f).offset(y = (-1).dp)
61+
modifier = Modifier
62+
.scale(0.8f)
63+
.offset(y = (-1).dp)
6264
) {
6365
Icon(
6466
imageVector = Icons.Default.Image,
@@ -102,25 +104,27 @@ fun DescriptionSection(
102104
verticalArrangement = Arrangement.spacedBy(2.dp)
103105
) {
104106
tags.forEach { tag ->
105-
ElevatedSuggestionChip(
106-
onClick = {
107-
// Minimize to bottom player
108-
viewModel.showAsBottomPlayer()
107+
if (tag.isNotEmpty()) {
108+
ElevatedSuggestionChip(
109+
onClick = {
110+
// Minimize to bottom player
111+
viewModel.showAsBottomPlayer()
109112

110-
// Navigate to search screen with tag as query
111-
navController.navigate(Screen.Search.createRoute(tag, streamInfo.serviceId))
112-
},
113-
label = {
114-
Text(
115-
text = tag,
116-
style = MaterialTheme.typography.bodySmall,
117-
fontWeight = FontWeight.SemiBold
113+
// Navigate to search screen with tag as query
114+
navController.navigate(Screen.Search.createRoute(tag, streamInfo.serviceId))
115+
},
116+
label = {
117+
Text(
118+
text = tag,
119+
style = MaterialTheme.typography.bodySmall,
120+
fontWeight = FontWeight.SemiBold
121+
)
122+
},
123+
colors = SuggestionChipDefaults.elevatedSuggestionChipColors(
124+
containerColor = MaterialTheme.colorScheme.surfaceContainerHighest
118125
)
119-
},
120-
colors = SuggestionChipDefaults.elevatedSuggestionChipColors(
121-
containerColor = MaterialTheme.colorScheme.surfaceContainerHighest
122126
)
123-
)
127+
}
124128
}
125129
}
126130
}

0 commit comments

Comments
 (0)