You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2024/03/19 15:56:58 UTC

(incubator-answer) branch dev updated: fix(connect): update user avatar only when there isn't any one (#857)

This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/dev by this push:
     new 623dfa57 fix(connect): update user avatar only when there isn't any one (#857)
623dfa57 is described below

commit 623dfa579a9156620b987fa50210a19ad268cbb7
Author: Octobug <wh...@gmail.com>
AuthorDate: Tue Mar 19 22:27:59 2024 +0800

    fix(connect): update user avatar only when there isn't any one (#857)
---
 internal/service/user_external_login/user_external_login_service.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/internal/service/user_external_login/user_external_login_service.go b/internal/service/user_external_login/user_external_login_service.go
index 6cd69aec..0923908f 100644
--- a/internal/service/user_external_login/user_external_login_service.go
+++ b/internal/service/user_external_login/user_external_login_service.go
@@ -252,7 +252,7 @@ func (us *UserExternalLoginService) activeUser(ctx context.Context, oldUserInfo
 	}
 
 	// try to update user avatar
-	if len(externalUserInfo.Avatar) > 0 {
+	if oldUserInfo.Avatar == "" && len(externalUserInfo.Avatar) > 0 {
 		avatarInfo := &schema.AvatarInfo{
 			Type:   constant.AvatarTypeCustom,
 			Custom: externalUserInfo.Avatar,