File tree Expand file tree Collapse file tree
app/src/main/java/app/morphe/manager/ui/screen/home Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1785,17 +1785,25 @@ fun DeepLinkAddSourceDialog(
17851785 horizontalAlignment = Alignment .CenterHorizontally ,
17861786 modifier = Modifier .fillMaxWidth()
17871787 ) {
1788- val owner = remember(url) {
1789- runCatching { URI (url).path.trim(' /' ).split(' /' ).firstOrNull() }.getOrNull()
1788+ val avatarUrl = remember(url) {
1789+ runCatching {
1790+ val uri = URI (url)
1791+ val owner = uri.path.trim(' /' ).split(' /' ).firstOrNull()
1792+ val isGitLab = uri.host?.contains(" gitlab.com" , ignoreCase = true ) == true
1793+ if (owner != null ) {
1794+ if (isGitLab) " https://unavatar.io/gitlab/$owner "
1795+ else " https://github.com/$owner .png"
1796+ } else null
1797+ }.getOrNull()
17901798 }
17911799 Surface (
17921800 shape = CircleShape ,
17931801 color = MaterialTheme .colorScheme.primaryContainer,
17941802 modifier = Modifier .size(56 .dp)
17951803 ) {
1796- if (owner != null ) {
1804+ if (avatarUrl != null ) {
17971805 RemoteAvatar (
1798- url = " https://github.com/ $owner .png " ,
1806+ url = avatarUrl ,
17991807 modifier = Modifier .fillMaxSize()
18001808 )
18011809 } else {
You can’t perform that action at this time.
0 commit comments