hide token transfers with decimal 0 from transaction list

This commit is contained in:
2026-05-22 12:31:59 +08:00
parent 357f707180
commit dade59722c
@@ -110,7 +110,8 @@
{/if} {/if}
</CardTitle> </CardTitle>
<CardDescription> <CardDescription>
Name your wallet and enter your seed phrase to save it securely Name your wallet and enter your seed phrase to save it
securely
</CardDescription> </CardDescription>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
@@ -131,12 +132,20 @@
<div class="flex gap-2"> <div class="flex gap-2">
<Button <Button
onclick={() => onclick={() =>
w.createWallet(inputWalletName, inputSeed, inputPassword || undefined)} w.createWallet(
disabled={w.loading || !inputSeed.trim() || !inputWalletName.trim()}> inputWalletName,
inputSeed,
inputPassword || undefined,
)}
disabled={w.loading ||
!inputSeed.trim() ||
!inputWalletName.trim()}>
{w.loading ? 'Saving...' : 'Save Wallet'} {w.loading ? 'Saving...' : 'Save Wallet'}
</Button> </Button>
{#if showCreateForm} {#if showCreateForm}
<Button variant="outline" onclick={() => (showCreateForm = false)}> <Button
variant="outline"
onclick={() => (showCreateForm = false)}>
Cancel Cancel
</Button> </Button>
{/if} {/if}
@@ -165,7 +174,9 @@
} }
}} }}
class="flex w-full cursor-pointer items-center gap-3 rounded-md border border-input p-3 text-left hover:bg-muted transition-colors"> class="flex w-full cursor-pointer items-center gap-3 rounded-md border border-input p-3 text-left hover:bg-muted transition-colors">
<WalletIcon size={20} class="shrink-0 text-muted-foreground" /> <WalletIcon
size={20}
class="shrink-0 text-muted-foreground" />
<div class="flex-1 min-w-0"> <div class="flex-1 min-w-0">
<p class="font-medium text-sm">{wal.name}</p> <p class="font-medium text-sm">{wal.name}</p>
<p class="text-xs text-muted-foreground"> <p class="text-xs text-muted-foreground">
@@ -174,12 +185,17 @@
</div> </div>
<div class="flex items-center gap-1"> <div class="flex items-center gap-1">
{#if wal.hasPassword} {#if wal.hasPassword}
<LockKeyhole size={14} class="text-muted-foreground" /> <LockKeyhole
size={14}
class="text-muted-foreground" />
{/if} {/if}
</div> </div>
</button> </button>
{/each} {/each}
<Button variant="outline" onclick={() => (showCreateForm = true)} class="mt-2"> <Button
variant="outline"
onclick={() => (showCreateForm = true)}
class="mt-2">
<Plus size={16} /> <Plus size={16} />
Add Wallet Add Wallet
</Button> </Button>
@@ -189,10 +205,10 @@
{:else if w.isLocked} {:else if w.isLocked}
<Card> <Card>
<CardHeader> <CardHeader>
<CardTitle>{w.currentWallet?.name ?? 'Wallet'} Locked</CardTitle> <CardTitle>
<CardDescription> {w.currentWallet?.name ?? 'Wallet'} Locked
Unlock to access your wallet </CardTitle>
</CardDescription> <CardDescription>Unlock to access your wallet</CardDescription>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<div class="flex flex-col gap-3"> <div class="flex flex-col gap-3">
@@ -269,7 +285,10 @@
{w.address} {w.address}
</p> </p>
<button <button
onclick={() => electrobun.rpc?.request.openExternal({ url: w.explorerAddressUrl })} onclick={() =>
electrobun.rpc?.request.openExternal({
url: w.explorerAddressUrl,
})}
class="shrink-0 cursor-pointer rounded-md border p-1.5 text-muted-foreground hover:bg-muted transition-colors"> class="shrink-0 cursor-pointer rounded-md border p-1.5 text-muted-foreground hover:bg-muted transition-colors">
<ExternalLink size={16} /> <ExternalLink size={16} />
</button> </button>
@@ -338,12 +357,12 @@
</div> </div>
{/if} {/if}
{#if w.loadingBalance && w.address} {#if w.loadingBalance && w.address}
<div class="flex justify-center py-4"> <div class="flex justify-center py-4">
<Loader /> <Loader />
</div> </div>
{/if} {/if}
{#if w.error} {#if w.error}
<p class="mb-3 text-red-500">{w.error}</p> <p class="mb-3 text-red-500">{w.error}</p>
{/if} {/if}
@@ -359,9 +378,7 @@
onclick={() => navigate('/settings')}> onclick={() => navigate('/settings')}>
<SettingsIcon size={16} /> <SettingsIcon size={16} />
</Button> </Button>
<Button <Button variant="outline" onclick={() => w.lock()}>
variant="outline"
onclick={() => w.lock()}>
<LockKeyhole size={16} /> <LockKeyhole size={16} />
Lock Lock
</Button> </Button>
@@ -405,7 +422,7 @@
</p> </p>
{:else} {:else}
<div class="max-h-96 space-y-1 overflow-y-auto"> <div class="max-h-96 space-y-1 overflow-y-auto">
{#each w.transactions as tx} {#each w.transactions.filter((tx) => tx.tokenDecimal !== '0') as tx}
<button <button
onclick={() => onclick={() =>
navigate('/tx/:chainid/:hash', { navigate('/tx/:chainid/:hash', {