Skip to content

Commit 124b811

Browse files
committed
fix(app2): no wallet
1 parent c6f5503 commit 124b811

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

app2/src/lib/components/Transfer/Amount.svelte

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ import { transfer } from "$lib/components/Transfer/transfer.svelte.ts"
44
import { Option } from "effect"
55
import { formatUnits } from "viem"
66
import Skeleton from "$lib/components/ui/Skeleton.svelte"
7+
import { wallets } from "$lib/stores/wallets.svelte.ts"
8+
9+
let chainWallet = $derived.by(() => {
10+
if (Option.isSome(transfer.sourceChain)) {
11+
return wallets.getAddressForChain(transfer.sourceChain.value)
12+
}
13+
return Option.none()
14+
})
715
816
function allDataReadyForBalance() {
917
return (
@@ -93,13 +101,15 @@ function setMaxAmount() {
93101

94102
<div class="flex w-full justify-between text-xs">
95103
<p>
96-
BALANCE:
97-
{#if !transfer.raw.source || !transfer.raw.asset}
98-
0
99-
{:else if !allDataReadyForBalance()}
100-
<Skeleton class="h-3 w-16 inline-block" />
101-
{:else}
102-
{displayBalance}
104+
{#if Option.isSome(chainWallet)}
105+
BALANCE:
106+
{#if !transfer.raw.source || !transfer.raw.asset}
107+
0
108+
{:else if !allDataReadyForBalance()}
109+
<Skeleton class="h-3 w-16 inline-block"/>
110+
{:else}
111+
{displayBalance}
112+
{/if}
103113
{/if}
104114
</p>
105115
<button

0 commit comments

Comments
 (0)