diff --git a/packages/authentication/CHANGELOG.md b/packages/authentication/CHANGELOG.md index 88a2f7c8..f271d200 100644 --- a/packages/authentication/CHANGELOG.md +++ b/packages/authentication/CHANGELOG.md @@ -1,5 +1,11 @@ # @baseapp-frontend/authentication +## 4.1.8 + +### Patch Changes + +- Fix image path handling for profile images + ## 4.1.7 ### Patch Changes diff --git a/packages/authentication/modules/access/useLogin/index.ts b/packages/authentication/modules/access/useLogin/index.ts index 08b4f7fe..3cd5f67c 100644 --- a/packages/authentication/modules/access/useLogin/index.ts +++ b/packages/authentication/modules/access/useLogin/index.ts @@ -61,7 +61,12 @@ const useLogin = ({ if (user) { // TODO: handle the absolute image path on the backend const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL?.replace('/v1', '') - const absoluteImagePath = user?.profile?.image ? `${baseUrl}${user.profile.image}` : null + let absoluteImagePath = null + if (user?.profile?.image) { + absoluteImagePath = user.profile.image.startsWith('http') + ? user.profile.image + : `${baseUrl}${user.profile.image}` + } setCurrentProfile({ ...user.profile, image: absoluteImagePath, diff --git a/packages/authentication/package.json b/packages/authentication/package.json index 49bb45c0..f878a74e 100644 --- a/packages/authentication/package.json +++ b/packages/authentication/package.json @@ -1,7 +1,7 @@ { "name": "@baseapp-frontend/authentication", "description": "Authentication modules.", - "version": "4.1.7", + "version": "4.1.8", "main": "./index.ts", "types": "dist/index.d.ts", "sideEffects": false, diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 6dd3d2e2..19a78142 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -1,5 +1,13 @@ # @baseapp-frontend/components +## 1.0.17 + +### Patch Changes + +- Fix image path handling for profile images +- Updated dependencies + - @baseapp-frontend/authentication@4.1.8 + ## 1.0.16 ### Patch Changes diff --git a/packages/components/modules/profiles/web/profile-popover/ProfilesList/index.tsx b/packages/components/modules/profiles/web/profile-popover/ProfilesList/index.tsx index b52d0ba9..36f2f5ff 100644 --- a/packages/components/modules/profiles/web/profile-popover/ProfilesList/index.tsx +++ b/packages/components/modules/profiles/web/profile-popover/ProfilesList/index.tsx @@ -41,7 +41,12 @@ const ProfilesList: FC = ({ if (currentProfile?.id !== profile.id) { // TODO: handle the absolute image path on the backend const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL?.replace('/v1', '') - const absoluteImagePath = profile.image ? `${baseUrl}${profile.image?.url}` : null + let absoluteImagePath = null + if (profile.image) { + absoluteImagePath = profile.image.url.startsWith('http') + ? profile.image.url + : `${baseUrl}${profile.image.url}` + } setCurrentProfile({ id: profile.id, diff --git a/packages/components/package.json b/packages/components/package.json index b842f14d..25492e13 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -1,7 +1,7 @@ { "name": "@baseapp-frontend/components", "description": "BaseApp components modules such as comments, notifications, messages, and more.", - "version": "1.0.16", + "version": "1.0.17", "sideEffects": false, "scripts": { "babel:transpile": "babel modules -d tmp-babel --extensions .ts,.tsx --ignore '**/__tests__/**','**/__storybook__/**'",