@@ -63,10 +63,12 @@ const AssetRow = memo(function AssetRow({
6363 b,
6464 onAssetClick,
6565 detailRef,
66+ showIssuerSuffix,
6667} : {
6768 b : Balance ;
6869 onAssetClick ?: ( balance : Balance ) => void ;
6970 detailRef ?: React . RefObject < HTMLElement | null > ;
71+ showIssuerSuffix ?: boolean ;
7072} ) {
7173 const isZeroBalance = Number ( b . balance ) === 0 ;
7274 const onClick = useCallback ( ( ) => {
@@ -98,7 +100,7 @@ const AssetRow = memo(function AssetRow({
98100 hasClickHandler && "cursor-pointer hover:bg-surface-2 transition-colors" ,
99101 ) }
100102 >
101- < AssetBadge balance = { b } />
103+ < AssetBadge balance = { b } showIssuerSuffix = { showIssuerSuffix } />
102104 < div className = "flex flex-col items-end gap-0.5" >
103105 < span
104106 className = { cn (
@@ -140,6 +142,15 @@ export function BalanceList({
140142
141143 const skeletonCount = balances . length > 0 ? balances . length : 3 ;
142144
145+ const codeCounts = useMemo ( ( ) => {
146+ const counts = new Map < string , number > ( ) ;
147+ for ( const b of balances ) {
148+ const code = getAssetCode ( b ) ;
149+ counts . set ( code , ( counts . get ( code ) ?? 0 ) + 1 ) ;
150+ }
151+ return counts ;
152+ } , [ balances ] ) ;
153+
143154 const filtered = useMemo (
144155 ( ) =>
145156 search
@@ -251,8 +262,15 @@ export function BalanceList({
251262 < div >
252263 { sorted . map ( ( b ) => (
253264 < AssetRow
254- key = { balanceKey ( b ) }
265+ key = {
266+ b . assetCode && b . assetIssuer
267+ ? b . assetCode + ":" + b . assetIssuer
268+ : b . asset + ":native"
269+ }
255270 b = { b }
271+ showIssuerSuffix = { Boolean (
272+ b . assetIssuer && ( codeCounts . get ( getAssetCode ( b ) ) ?? 0 ) > 1 ,
273+ ) }
256274 onAssetClick = { onAssetClick }
257275 detailRef = { detailRef }
258276 />
@@ -268,8 +286,15 @@ export function BalanceList({
268286 </ div >
269287 { sortedLp . map ( ( b ) => (
270288 < AssetRow
271- key = { balanceKey ( b ) }
289+ key = {
290+ b . assetCode && b . assetIssuer
291+ ? b . assetCode + ":" + b . assetIssuer
292+ : b . asset + ":native"
293+ }
272294 b = { b }
295+ showIssuerSuffix = { Boolean (
296+ b . assetIssuer && ( codeCounts . get ( getAssetCode ( b ) ) ?? 0 ) > 1 ,
297+ ) }
273298 onAssetClick = { onAssetClick }
274299 detailRef = { detailRef }
275300 />
0 commit comments