Skip to content

Commit

Permalink
[dapp-kit] ensure that wallet-icon is a non-empty string (#20304)
Browse files Browse the repository at this point in the history
## Description 

Describe the changes or additions included in this PR.

## Test plan 

How did you test the new or updated feature?

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
hayes-mysten authored Nov 18, 2024
1 parent 4bac808 commit ec919a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-ants-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mysten/dapp-kit': patch
---

Ensure wallet-icon is a non-empty string before rendering
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ export function ConnectionStatus({
}: ConnectionStatusProps) {
return (
<div className={styles.container}>
<img
className={styles.walletIcon}
src={selectedWallet.icon}
alt={`${selectedWallet.name} logo`}
/>
{selectedWallet.icon && (
<img
className={styles.walletIcon}
src={selectedWallet.icon}
alt={`${selectedWallet.name} logo`}
/>
)}
<div className={styles.title}>
<Heading as="h2" size="xl">
Opening {selectedWallet.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function WalletListItem({ name, icon, onClick, isSelected = false }: Wall
type="button"
onClick={onClick}
>
{typeof icon === 'string' ? (
{icon && typeof icon === 'string' ? (
<img className={styles.walletIcon} src={icon} alt={`${name} logo`} />
) : (
icon
Expand Down

0 comments on commit ec919a0

Please sign in to comment.