Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sculas <contact@sculas.xyz>
Co-authored-by: Wing <44992537+wingio@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 6, 2023
1 parent 84cf0a6 commit ed73cf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ fun RowScope.LargeSegmentedButton(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp, Alignment.CenterVertically),
modifier = Modifier
.clickable(enabled) { onClick() }
.clickable(enabled = enabled, role = Role.Button) { onClick() }
.background(MaterialTheme.colorScheme.surfaceColorAtElevation(2.dp))
.weight(1f)
.padding(16.dp)

) {
when (icon) {
is ImageVector -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class RepoDetailsViewModel(
}

fun starRepo() {
updateStarDetails(true)
updateStarDetails(starred = true)

coroutineScope.launch {
isStarLoading = true
Expand All @@ -62,7 +62,7 @@ class RepoDetailsViewModel(
isStarLoading = false
},
onError = {
updateStarDetails(false)
updateStarDetails(starred = false)

isStarLoading = false
hasError = true
Expand All @@ -72,7 +72,7 @@ class RepoDetailsViewModel(
}

fun unstarRepo() {
updateStarDetails(false)
updateStarDetails(starred = false)

coroutineScope.launch {
isStarLoading = true
Expand All @@ -82,7 +82,7 @@ class RepoDetailsViewModel(
isStarLoading = false
},
onError = {
updateStarDetails(true)
updateStarDetails(starred = true)

isStarLoading = false
hasError = true
Expand Down

0 comments on commit ed73cf9

Please sign in to comment.