Fix repo name used for URL instead of baseUrl (#572)
* Fix repo name used for URL instead of baseUrl This applies to both the item being shown in the screen as well as the "copy to clipboard" button. Before, copying a repo url would return "The Repo Name/index.json.min". This PR fixes that. * Correct Misunderstanding Passing the whole ExtensionRepo data class through now, using the name for display purposes and the baseUrl for copying the URL. (cherry picked from commit da20d00481f112802aade5d63fc1eca15c5496ba)
This commit is contained in:
parent
9ee0034c9a
commit
fb4d9209f8
@ -47,7 +47,7 @@ fun ExtensionReposContent(
|
|||||||
item {
|
item {
|
||||||
ExtensionRepoListItem(
|
ExtensionRepoListItem(
|
||||||
modifier = Modifier.animateItemPlacement(),
|
modifier = Modifier.animateItemPlacement(),
|
||||||
repo = it.name,
|
repo = it,
|
||||||
onOpenWebsite = { onOpenWebsite(it) },
|
onOpenWebsite = { onOpenWebsite(it) },
|
||||||
onDelete = { onClickDelete(it.baseUrl) },
|
onDelete = { onClickDelete(it.baseUrl) },
|
||||||
)
|
)
|
||||||
@ -58,7 +58,7 @@ fun ExtensionReposContent(
|
|||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun ExtensionRepoListItem(
|
private fun ExtensionRepoListItem(
|
||||||
repo: String,
|
repo: ExtensionRepo,
|
||||||
onOpenWebsite: () -> Unit,
|
onOpenWebsite: () -> Unit,
|
||||||
onDelete: () -> Unit,
|
onDelete: () -> Unit,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
@ -80,7 +80,7 @@ private fun ExtensionRepoListItem(
|
|||||||
) {
|
) {
|
||||||
Icon(imageVector = Icons.AutoMirrored.Outlined.Label, contentDescription = null)
|
Icon(imageVector = Icons.AutoMirrored.Outlined.Label, contentDescription = null)
|
||||||
Text(
|
Text(
|
||||||
text = repo,
|
text = repo.name,
|
||||||
modifier = Modifier.padding(start = MaterialTheme.padding.medium),
|
modifier = Modifier.padding(start = MaterialTheme.padding.medium),
|
||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.titleMedium,
|
||||||
)
|
)
|
||||||
@ -99,7 +99,7 @@ private fun ExtensionRepoListItem(
|
|||||||
|
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = {
|
onClick = {
|
||||||
val url = "$repo/index.min.json"
|
val url = "${repo.baseUrl}/index.min.json"
|
||||||
context.copyToClipboard(url, url)
|
context.copyToClipboard(url, url)
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user