Texera / texera

Collaborative Machine-Learning-Centric Data Analytics Using Workflows
https://texera.github.io
Apache License 2.0
163 stars 75 forks source link

Fix incorrect Google avatar URL generation to prevent connection errors #3077

Closed GspikeHalo closed 5 days ago

GspikeHalo commented 5 days ago

Purpose:

This PR aims to fix the issue of generating incorrect Google avatar URLs, which leads to connection errors during avatar retrieval. When fetching a user avatar, a connection error is triggered if the avatar is not a Google avatar. The error occurs because, when assigning the Google avatar URL to the google-avatar attribute of the user avatar component, the base URL "https://lh3.googleusercontent.com/a/" is appended regardless of whether the google-avatar value retrieved from the backend is empty or not.

Changes:

  1. Modify user-avatar.component.html to complete the base URL internally rather than having it passed from the parent component. Add logic within the component to check whether the provided googleAvatar is empty.
  2. Modify other components using the user-avatar component to directly pass the Google avatar retrieved from the backend to the user-avatar component.

Demo:

old network in home page: image

new network in home page: image