Skip to content

Commit

Permalink
fix: conversion to hex value for lens profile id (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum authored Oct 14, 2022
1 parent 21c48c3 commit fcb1f35
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/modal/components/CreateProfile/Lens/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ export const getLensTokenIdDecimal = (lenseProfileId: Profile["id"]) => {
};

export const getLensTokenIdHex = (lenseProfileIdDecimal: Profile["id"]) => {
return lenseProfileIdDecimal
? "0x" + Number(lenseProfileIdDecimal).toString(16).padStart(2, "0")
: "";
if (!lenseProfileIdDecimal) {
return "";
}
const hex = Number(lenseProfileIdDecimal).toString(16);
if (hex.length % 2 === 0) {
return "0x" + hex;
}
return "0x0" + hex;
};

0 comments on commit fcb1f35

Please sign in to comment.