Skip to content

Commit c4520a2

Browse files
Update apps/desktop/app/components/@settings/tabs/gitlab/GitLabTab.tsx
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Gerome <[email protected]>
1 parent 80bd2c7 commit c4520a2

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

apps/desktop/app/components/@settings/tabs/gitlab/GitLabTab.tsx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -206,38 +206,18 @@ export default function GitLabTab() {
206206
<div className="w-12 h-12 rounded-full border-2 border-codinit-elements-item-contentAccent flex items-center justify-center bg-codinit-elements-background-depth-2 overflow-hidden">
207207
{connection.user.avatar_url &&
208208
connection.user.avatar_url !== 'null' &&
209-
connection.user.avatar_url !== '' ? (
209+
connection.user.avatar_url !== '' && !avatarLoadError ? (
210210
<img
211211
src={connection.user.avatar_url}
212212
alt={connection.user.username}
213213
className="w-full h-full rounded-full object-cover"
214-
onError={(e) => {
215-
const target = e.target as HTMLImageElement;
216-
target.style.display = 'none';
217-
218-
const parent = target.parentElement;
219-
220-
if (parent) {
221-
parent.innerHTML = (connection.user?.name || connection.user?.username || 'U')
222-
.charAt(0)
223-
.toUpperCase();
224-
parent.classList.add(
225-
'text-white',
226-
'font-semibold',
227-
'text-sm',
228-
'flex',
229-
'items-center',
230-
'justify-center',
231-
);
232-
}
233-
}}
214+
onError={() => setAvatarLoadError(true)}
234215
/>
235216
) : (
236217
<div className="w-full h-full rounded-full bg-codinit-elements-item-contentAccent flex items-center justify-center text-white font-semibold text-sm">
237218
{(connection.user?.name || connection.user?.username || 'U').charAt(0).toUpperCase()}
238219
</div>
239220
)}
240-
</div>
241221
<div>
242222
<h4 className="text-sm font-medium text-codinit-elements-textPrimary">
243223
{connection.user?.name || connection.user?.username}

0 commit comments

Comments
 (0)