Skip to content

Commit

Permalink
fix: ensure the LENS profile/cover images have a type, as it is verif…
Browse files Browse the repository at this point in the history
…ied by ProductType form values validation (#984)
  • Loading branch information
levalleux-ludo authored Jan 4, 2024
1 parent 3d02a04 commit 863640f
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/components/modal/components/Profile/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,26 @@ export function buildProfileFromMetadata(
(img) => img.tag === "cover"
);
const isLens = useLens && lensProfile;
const lensCoverPicture = isLens
? { url: getLensCoverPictureUrl(lensProfile), type: "" } // type is not necessary
: null;
const lensProfileImage = isLens
? { url: getLensProfilePictureUrl(lensProfile), type: "" }
: null;
let lensCoverPicture = null,
lensProfileImage = null;
if (isLens) {
const lensCoverPictureUrl = getLensCoverPictureUrl(lensProfile);
const lensCoverPictureType = lensCoverPictureUrl
? "image/" + lensCoverPictureUrl.split(".").pop()
: "";
lensCoverPicture = {
url: lensCoverPictureUrl,
type: lensCoverPictureType
};
const lensProfileImageUrl = getLensProfilePictureUrl(lensProfile);
const lensProfileImageType = lensProfileImageUrl
? "image/" + lensProfileImageUrl.split(".").pop()
: "";
lensProfileImage = {
url: lensProfileImageUrl,
type: lensProfileImageType
};
}
const coverPicture = lensCoverPicture || regularCoverPicture;
const profileImage = lensProfileImage || regularProfileImage;
const email = isLens
Expand Down

0 comments on commit 863640f

Please sign in to comment.