From 53d2893b8a4d6617d6e501d3d5827801f83ca4d4 Mon Sep 17 00:00:00 2001 From: triesap Date: Wed, 18 Feb 2026 22:49:14 +0000 Subject: [PATCH 1/4] Fix wallet status when wallet is unreachable --- src/routes/settings/wallet/+page.svelte | 144 +++++++++++++++++++----- 1 file changed, 116 insertions(+), 28 deletions(-) diff --git a/src/routes/settings/wallet/+page.svelte b/src/routes/settings/wallet/+page.svelte index fce83dbc..dfc4e65a 100644 --- a/src/routes/settings/wallet/+page.svelte +++ b/src/routes/settings/wallet/+page.svelte @@ -1,5 +1,5 @@
@@ -50,9 +111,17 @@ Wallet {#if $session?.wallet} -
- - Connected +
+ {#if walletStatus === "checking"} + + Checking + {:else if walletStatus === "connected"} + + Connected + {:else} + + Unavailable + {/if}
{:else}
- -- 2.52.0 From e24d51310ecb325764372ad2e1d1b93faf8d111e Mon Sep 17 00:00:00 2001 From: triesap Date: Wed, 18 Feb 2026 22:56:12 +0000 Subject: [PATCH 2/4] Add wallet status retry and WebLN probe --- src/routes/settings/wallet/+page.svelte | 31 ++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/routes/settings/wallet/+page.svelte b/src/routes/settings/wallet/+page.svelte index dfc4e65a..ff7292c9 100644 --- a/src/routes/settings/wallet/+page.svelte +++ b/src/routes/settings/wallet/+page.svelte @@ -68,6 +68,22 @@ } } + const checkWebLnStatus = async () => { + const webLn = getWebLn() + + if (!webLn) { + return "unavailable" as const + } + + try { + await withTimeout(webLn.getInfo(), 5000) + return "connected" as const + } catch (error) { + console.warn("WebLN wallet unavailable", error) + return "unavailable" as const + } + } + let walletStatus = $state<"checking" | "connected" | "unavailable">("checking") let walletStatusRequestId = 0 @@ -80,7 +96,7 @@ ) const connectionVerb = $derived(walletStatus === "connected" ? "Connected to" : "Configured for") - $effect(() => { + const startWalletStatusCheck = () => { const wallet = $session?.wallet if (!wallet) { @@ -93,13 +109,19 @@ walletStatus = "checking" void (async () => { - const nextStatus = - wallet.type === "nwc" ? await checkNwcStatus() : getWebLn() ? "connected" : "unavailable" + const nextStatus = wallet.type === "nwc" ? await checkNwcStatus() : await checkWebLnStatus() if (requestId === walletStatusRequestId) { walletStatus = nextStatus } })() + } + + const retryStatus = () => startWalletStatusCheck() + + $effect(() => { + $session?.wallet + startWalletStatusCheck() }) @@ -122,6 +144,9 @@ Unavailable {/if} + {#if walletStatus === "unavailable"} + + {/if}
{:else} - {/if}
{:else}