Skip to content

Commit

Permalink
Show platform toggle button when more than two platforms are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Taewan-P committed Mar 4, 2025
1 parent e8e54e8 commit 7748189
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,23 @@ fun ChatScreen(
verticalAlignment = Alignment.CenterVertically
) {
GPTMobileIcon(if (i == groupedMessages.assistantMessages.size - 1) !isIdle else false)
Row(
modifier = Modifier
.padding(horizontal = 16.dp)
.fillMaxWidth()
.horizontalScroll(rememberScrollState())
) {
chatViewModel.enabledPlatformsInChat.forEachIndexed { j, uid ->
val platform = appEnabledPlatforms.find { it.uid == uid }
PlatformButton(
isLoading = if (i == groupedMessages.assistantMessages.size - 1) isLoading else false,
name = platform?.name ?: stringResource(R.string.unknown),
selected = platformIndexState == j,
onPlatformClick = { chatViewModel.updateChatPlatformIndex(i, j) }
)
Spacer(modifier = Modifier.width(8.dp))
if (chatViewModel.enabledPlatformsInChat.size > 1) {
Row(
modifier = Modifier
.padding(horizontal = 16.dp)
.fillMaxWidth()
.horizontalScroll(rememberScrollState())
) {
chatViewModel.enabledPlatformsInChat.forEachIndexed { j, uid ->
val platform = appEnabledPlatforms.find { it.uid == uid }
PlatformButton(
isLoading = if (i == groupedMessages.assistantMessages.size - 1) isLoading else false,
name = platform?.name ?: stringResource(R.string.unknown),
selected = platformIndexState == j,
onPlatformClick = { chatViewModel.updateChatPlatformIndex(i, j) }
)
Spacer(modifier = Modifier.width(8.dp))
}
}
}
}
Expand Down

0 comments on commit 7748189

Please sign in to comment.