Skip to content

Fix rendering error on MyLiquidity page for accounts with unknown tokens #247

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

Closed
dib542 opened this issue Dec 20, 2022 · 1 comment
Closed
Assignees
Milestone

Comments

@dib542
Copy link
Collaborator

dib542 commented Dec 20, 2022

There is a rendering error on the MyLiquidity page if a user holds tokens that are not known

Image

This appears to be partly a TypeScript issue: the token Type from the below code is Token not Token | undefined

      // allUserTokensList is type Token[]
      const tokenIndex = allUserTokensList.findIndex(matchTokenDenom(denom));
      const token = allUserTokensList[tokenIndex];

This is a long and divisive issue in TypeScript microsoft/TypeScript#13778 because flagged all items found by index can be problematic in many places that they are expected to be known. However as a resolution, a --noUncheckedIndexedAccess flag can be used to turn on checking for this.

@dib542 dib542 self-assigned this Dec 20, 2022
@dib542 dib542 modified the milestones: Alpha, Beta May 2, 2023
@dib542
Copy link
Collaborator Author

dib542 commented May 2, 2023

This was fixed through better code practices in:

The issue in general has been moved to:

@dib542 dib542 closed this as completed May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant