Skip to content
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

fix unknownAssetId bugs #1110

Merged
merged 3 commits into from
May 14, 2024
Merged

fix unknownAssetId bugs #1110

merged 3 commits into from
May 14, 2024

Conversation

Valentine1898
Copy link
Contributor

@Valentine1898 Valentine1898 commented May 14, 2024

close #1107 & close #1108

1. Dashboard
Before:
image
After:
image


2. Send
Before:
image
After:
image


3. Tx page
Before:
image
After:
image


@Valentine1898 Valentine1898 linked an issue May 14, 2024 that may be closed by this pull request
@Valentine1898 Valentine1898 force-pushed the 1108-unknown-asset-selected-bug branch from 6d92f29 to 9f05366 Compare May 14, 2024 14:53
Comment on lines -155 to -156
if (asset.balanceView?.valueView.case !== 'knownAssetId')
throw new Error('unknown asset selected');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We filter out unknown assets for ibc and swaps, but I believe there is no reason to disallow sending unknown assets

@Valentine1898
Copy link
Contributor Author

Not relevant to this PR, but maybe we don't need to show zero balances?

Copy link
Contributor

@grod220 grod220 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Not relevant to this PR, but maybe we don't need to show zero balances?

Good idea, can you create an issue?

Comment on lines 36 to 55
const renderPill = (formattedAmount: string, symbol: string, metadata?: Metadata) => (
<Pill variant={variant === 'default' ? 'default' : 'dashed'}>
<div className='flex min-w-0 items-center gap-1'>
{showIcon && (
<div className='-ml-2 mr-1 flex shrink-0 items-center justify-center rounded-full'>
<AssetIcon metadata={metadata} size={size === 'default' ? 'sm' : 'xs'} />
</div>
)}
{showValue && (
<span className={cn('-mb-0.5 text-nowrap leading-[15px]', size === 'sm' && 'text-xs')}>
{variant === 'equivalent' && <>~ </>}
{formattedAmount}
</span>
)}
{showDenom && (
<span className='truncate font-mono text-xs text-muted-foreground'>{symbol}</span>
)}
</div>
</Pill>
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this a separate component instead of an inline function?

@Valentine1898 Valentine1898 merged commit 6a48a0a into main May 14, 2024
6 checks passed
@Valentine1898 Valentine1898 deleted the 1108-unknown-asset-selected-bug branch May 14, 2024 21:47
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

Successfully merging this pull request may close these issues.

Unknown asset selected bug passet rendering bug
3 participants