File tree 1 file changed +15
-1
lines changed
components/server/ee/src/gitlab 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export class GitLabAppSupport {
43
43
const fullPath = anyProject . path_with_namespace as string ;
44
44
const cloneUrl = anyProject . http_url_to_repo as string ;
45
45
const updatedAt = anyProject . last_activity_at as string ;
46
- const accountAvatarUrl = anyProject . owner ?. avatar_url as string ;
46
+ const accountAvatarUrl = await this . getAccountAvatarUrl ( anyProject , params . provider . host ) ;
47
47
const account = fullPath . split ( "/" ) [ 0 ] ;
48
48
49
49
( account === usersGitLabAccount ? ownersRepos : result ) . push ( {
@@ -61,4 +61,18 @@ export class GitLabAppSupport {
61
61
result . unshift ( ...ownersRepos ) ;
62
62
return result ;
63
63
}
64
+
65
+ protected async getAccountAvatarUrl ( anyProject : any , providerHost : string ) : Promise < string > {
66
+ if ( anyProject . owner ?. avatar_url ) {
67
+ return anyProject . owner . avatar_url ;
68
+ }
69
+ if ( anyProject . namespace ?. avatar_url ) {
70
+ let url = anyProject . namespace . avatar_url ;
71
+ if ( url [ 0 ] === "/" ) {
72
+ url = `https://${ providerHost } ${ url } ` ;
73
+ }
74
+ return url ;
75
+ }
76
+ return "" ;
77
+ }
64
78
}
You can’t perform that action at this time.
0 commit comments