-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π(lld) hedera split address #8381
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ 4 Skipped Deployments
|
5da329a
to
fbc4d21
Compare
|
||
// FIXME why not using CSS for this? meaning we might be able to have a left & right which both take 50% & play with overflow & text-align | ||
const left = value.slice(0, third); | ||
const right = value.slice(third, value.length); | ||
let left, right; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a unit test here. Please extract this into a dedicated function that returns left and right and we can check all possibilities.
fbc4d21
to
7685898
Compare
let left, right; | ||
if (value.includes(".")) { | ||
const parts = value.split("."); | ||
left = parts[0] + "."; | ||
right = parts.slice(1).join("."); | ||
} else { | ||
const third = Math.round(value.length / 3); | ||
left = value.slice(0, third); | ||
right = value.slice(third, value.length); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should put this part outside your component, and add unit test :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I will I just did a rebase
7685898
to
0c8a0c0
Compare
β Checklist
npx changeset
was attached.π Description
Split address didn't consider special characters that's why hedera address was strangely displayed. The bug was surely with all other coin with address containing special chars
All other addresses won't be affected since we now use a condition
This may change the splitting since we are based on the dots but Hedera might be the only to have addresses with special char in it
Note
The behaviour has been validated by Product since the split with dots of an Hedera address should be rare. And there is no other addresses like this AFAWK
β Context
π§ Checklist for the PR Reviewers