From 195e372f5389f7dace50ad0be96dc42fc95e01bc Mon Sep 17 00:00:00 2001 From: Pyiner Date: Sun, 29 Mar 2026 00:32:39 +0800 Subject: [PATCH] fix: propagate getInfo() error to trigger disconnect on connection failure When a wallet connection fails (e.g., invalid credentials), getInfo() throws an error that was previously swallowed. This caused the UI to incorrectly show 'Connected through [name]' even though the connection failed. The outer catch block already handles disconnection and error display properly. By re-throwing the getInfo() error, we ensure it reaches that handler and the UI correctly reflects the failed connection state. Fixes #174 --- src/state/store.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/state/store.ts b/src/state/store.ts index c332dd0..a7ddf58 100644 --- a/src/state/store.ts +++ b/src/state/store.ts @@ -86,7 +86,8 @@ const store = createStore((set, get) => ({ try { info = await provider.getInfo(); } catch (error) { - console.error('Failed to request wallet info'); + console.error('Failed to request wallet info', error); + throw error; } // In case user cancels the connection