[gitlab] show default avatar image when user avatar is missing or we cant load it

IDEA-312969 Fixed

GitOrigin-RevId: 3171d62f42f982e1fe6e1958229a7f4d14d1590a
This commit is contained in:
Ivan Semenov
2023-05-16 18:53:32 +02:00
committed by intellij-monorepo-bot
parent a14a9a77ed
commit 4088653b40

View File

@@ -2,7 +2,7 @@
package org.jetbrains.plugins.gitlab.authentication.ui
import com.intellij.collaboration.auth.ui.LazyLoadingAccountsDetailsProvider
import com.intellij.util.ui.EmptyIcon
import icons.CollaborationToolsIcons
import kotlinx.coroutines.CoroutineScope
import org.jetbrains.plugins.gitlab.api.GitLabApi
import org.jetbrains.plugins.gitlab.api.dto.GitLabUserDTO
@@ -14,7 +14,7 @@ import java.awt.Image
internal class GitLabAccountsDetailsProvider(scope: CoroutineScope,
private val apiClientSupplier: suspend (GitLabAccount) -> GitLabApi?)
: LazyLoadingAccountsDetailsProvider<GitLabAccount, GitLabUserDTO>(scope, EmptyIcon.ICON_16) {
: LazyLoadingAccountsDetailsProvider<GitLabAccount, GitLabUserDTO>(scope, CollaborationToolsIcons.Review.DefaultAvatar) {
override suspend fun loadDetails(account: GitLabAccount): Result<GitLabUserDTO> {
val api = apiClientSupplier(account) ?: return Result.Error(GitLabBundle.message("account.token.missing"), true)