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:
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.
Modify other components using the user-avatar component to directly pass the Google avatar retrieved from the backend to the user-avatar component.
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:
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 providedgoogleAvatar
is empty.user-avatar
component to directly pass the Google avatar retrieved from the backend to theuser-avatar
component.Demo:
old network in home page:
new network in home page: